summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/u-boot-spl.lds12
-rw-r--r--arch/arm/mach-zynq/clk.c6
-rw-r--r--arch/sandbox/cpu/cpu.c9
-rw-r--r--arch/sandbox/cpu/state.c4
-rw-r--r--arch/sandbox/dts/test.dts67
-rw-r--r--arch/sandbox/include/asm/state.h3
-rw-r--r--arch/sandbox/include/asm/test.h19
-rw-r--r--arch/sandbox/include/asm/u-boot-sandbox.h3
-rw-r--r--arch/x86/include/asm/interrupt.h4
9 files changed, 96 insertions, 31 deletions
diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
index a8be204..c5b4f7c 100644
--- a/arch/arm/cpu/u-boot-spl.lds
+++ b/arch/arm/cpu/u-boot-spl.lds
@@ -32,17 +32,17 @@ SECTIONS
}
. = ALIGN(4);
- .u_boot_list : {
- KEEP(*(SORT(.u_boot_list*_i2c_*)));
- }
-
- . = .;
#ifdef CONFIG_SPL_DM
.u_boot_list : {
KEEP(*(SORT(.u_boot_list_*_driver_*)));
KEEP(*(SORT(.u_boot_list_*_uclass_*)));
}
#endif
+ . = .;
+ .u_boot_list : {
+ KEEP(*(SORT(.u_boot_list*_i2c_*)));
+ }
+
. = ALIGN(4);
__image_copy_end = .;
@@ -66,7 +66,7 @@ SECTIONS
. = ALIGN(4);
__bss_end = .;
}
-
+ __bss_size = __bss_end - __bss_start;
.dynsym _image_binary_end : { *(.dynsym) }
.dynbss : { *(.dynbss) }
.dynstr : { *(.dynstr*) }
diff --git a/arch/arm/mach-zynq/clk.c b/arch/arm/mach-zynq/clk.c
index d2885dc..6444be8 100644
--- a/arch/arm/mach-zynq/clk.c
+++ b/arch/arm/mach-zynq/clk.c
@@ -48,11 +48,11 @@ DECLARE_GLOBAL_DATA_PTR;
struct clk;
/**
- * struct clk_ops:
+ * struct zynq_clk_ops:
* @set_rate: Function pointer to set_rate() implementation
* @get_rate: Function pointer to get_rate() implementation
*/
-struct clk_ops {
+struct zynq_clk_ops {
int (*set_rate)(struct clk *clk, unsigned long rate);
unsigned long (*get_rate)(struct clk *clk);
};
@@ -72,7 +72,7 @@ struct clk {
enum zynq_clk parent;
unsigned int flags;
u32 *reg;
- struct clk_ops ops;
+ struct zynq_clk_ops ops;
};
#define ZYNQ_CLK_FLAGS_HAS_2_DIVS 1
diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index e6ddb17..3a7f5a0 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -20,7 +20,7 @@ static struct udevice *map_dev;
unsigned long map_len;
#endif
-void reset_cpu(ulong ignored)
+void sandbox_exit(void)
{
/* Do this here while it still has an effect */
os_fd_restore();
@@ -34,13 +34,6 @@ void reset_cpu(ulong ignored)
os_exit(0);
}
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
- reset_cpu(0);
-
- return 0;
-}
-
/* delay x useconds */
void __udelay(unsigned long usec)
{
diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
index cae731c..7e5d03e 100644
--- a/arch/sandbox/cpu/state.c
+++ b/arch/sandbox/cpu/state.c
@@ -345,6 +345,10 @@ int state_init(void)
state->ram_buf = os_malloc(state->ram_size);
assert(state->ram_buf);
+ /* No reset yet, so mark it as such. Always allow power reset */
+ state->last_reset = RESET_COUNT;
+ state->reset_allowed[RESET_POWER] = true;
+
/*
* Example of how to use GPIOs:
*
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index c25614a..c948df8 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -4,7 +4,7 @@
model = "sandbox";
compatible = "sandbox";
#address-cells = <1>;
- #size-cells = <0>;
+ #size-cells = <1>;
aliases {
console = &uart0;
@@ -28,7 +28,7 @@
};
a-test {
- reg = <0>;
+ reg = <0 1>;
compatible = "denx,u-boot-fdt-test";
ping-expect = <0>;
ping-add = <0>;
@@ -41,16 +41,16 @@
};
junk {
- reg = <1>;
+ reg = <1 1>;
compatible = "not,compatible";
};
no-compatible {
- reg = <2>;
+ reg = <2 1>;
};
b-test {
- reg = <3>;
+ reg = <3 1>;
compatible = "denx,u-boot-fdt-test";
ping-expect = <3>;
ping-add = <3>;
@@ -60,7 +60,7 @@
#address-cells = <1>;
#size-cells = <0>;
compatible = "denx,u-boot-test-bus";
- reg = <3>;
+ reg = <3 1>;
ping-expect = <4>;
ping-add = <4>;
c-test@5 {
@@ -84,14 +84,14 @@
};
d-test {
- reg = <3>;
+ reg = <3 1>;
ping-expect = <6>;
ping-add = <6>;
compatible = "google,another-fdt-test";
};
e-test {
- reg = <3>;
+ reg = <3 1>;
ping-expect = <6>;
ping-add = <6>;
compatible = "google,another-fdt-test";
@@ -105,6 +105,10 @@
compatible = "denx,u-boot-fdt-test";
};
+ clk@0 {
+ compatible = "sandbox,clk";
+ };
+
eth@10002000 {
compatible = "sandbox,eth";
reg = <0x10002000 0x1000>;
@@ -142,7 +146,7 @@
i2c@0 {
#address-cells = <1>;
#size-cells = <0>;
- reg = <0>;
+ reg = <0 1>;
compatible = "sandbox,i2c";
clock-frequency = <100000>;
eeprom@2c {
@@ -176,6 +180,24 @@
};
};
+ leds {
+ compatible = "gpio-leds";
+
+ iracibble {
+ gpios = <&gpio_a 1 0>;
+ label = "sandbox:red";
+ };
+
+ martinet {
+ gpios = <&gpio_a 2 0>;
+ label = "sandbox:green";
+ };
+ };
+
+ mmc {
+ compatible = "sandbox,mmc";
+ };
+
pci: pci-controller {
compatible = "sandbox,pci";
device_type = "pci";
@@ -192,10 +214,22 @@
};
};
+ ram {
+ compatible = "sandbox,ram";
+ };
+
+ reset@0 {
+ compatible = "sandbox,warm-reset";
+ };
+
+ reset@1 {
+ compatible = "sandbox,reset";
+ };
+
spi@0 {
#address-cells = <1>;
#size-cells = <0>;
- reg = <0>;
+ reg = <0 1>;
compatible = "sandbox,spi";
cs-gpios = <0>, <&gpio_a 0>;
spi.bin@0 {
@@ -206,6 +240,19 @@
};
};
+ syscon@0 {
+ compatible = "sandbox,syscon0";
+ reg = <0x10 4>;
+ };
+
+ syscon@1 {
+ compatible = "sandbox,syscon1";
+ reg = <0x20 5
+ 0x28 6
+ 0x30 7
+ 0x38 8>;
+ };
+
uart0: serial {
compatible = "sandbox,serial";
u-boot,dm-pre-reloc;
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index a57480a..2bd28f6 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -7,6 +7,7 @@
#define __SANDBOX_STATE_H
#include <config.h>
+#include <reset.h>
#include <stdbool.h>
#include <linux/stringify.h>
@@ -59,6 +60,8 @@ struct sandbox_state {
bool write_state; /* Write sandbox state on exit */
bool ignore_missing_state_on_read; /* No error if state missing */
bool show_lcd; /* Show LCD on start-up */
+ enum reset_t last_reset; /* Last reset type */
+ bool reset_allowed[RESET_COUNT]; /* Allowed reset types */
enum state_terminal_raw term_raw; /* Terminal raw/cooked */
/* Pointer to information for each SPI bus/cs */
diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index 91a5c79..d3c7851 100644
--- a/arch/sandbox/include/asm/test.h
+++ b/arch/sandbox/include/asm/test.h
@@ -17,6 +17,25 @@
#define SANDBOX_PCI_CLASS_CODE PCI_CLASS_CODE_COMM
#define SANDBOX_PCI_CLASS_SUB_CODE PCI_CLASS_SUB_CODE_COMM_SERIAL
+#define SANDBOX_CLK_RATE 32768
+
+enum {
+ PERIPH_ID_FIRST = 0,
+ PERIPH_ID_SPI = PERIPH_ID_FIRST,
+ PERIPH_ID_I2C,
+ PERIPH_ID_PCI,
+
+ PERIPH_ID_COUNT,
+};
+
+/* System controller driver data */
+enum {
+ SYSCON0 = 32,
+ SYSCON1,
+
+ SYSCON_COUNT
+};
+
/**
* sandbox_i2c_set_test_mode() - set test mode for running unit tests
*
diff --git a/arch/sandbox/include/asm/u-boot-sandbox.h b/arch/sandbox/include/asm/u-boot-sandbox.h
index da87cc3..2f3c3f9 100644
--- a/arch/sandbox/include/asm/u-boot-sandbox.h
+++ b/arch/sandbox/include/asm/u-boot-sandbox.h
@@ -83,4 +83,7 @@ void sandbox_set_enable_pci_map(int enable);
*/
int sandbox_read_fdt_from_file(void);
+/* Exit sandbox (quit U-Boot) */
+void sandbox_exit(void);
+
#endif /* _U_BOOT_SANDBOX_H_ */
diff --git a/arch/x86/include/asm/interrupt.h b/arch/x86/include/asm/interrupt.h
index 0a75f89..00cbe07 100644
--- a/arch/x86/include/asm/interrupt.h
+++ b/arch/x86/include/asm/interrupt.h
@@ -16,10 +16,6 @@
/* arch/x86/cpu/interrupts.c */
void set_vector(u8 intnum, void *routine);
-/* arch/x86/lib/interrupts.c */
-void disable_irq(int irq);
-void enable_irq(int irq);
-
/* Architecture specific functions */
void mask_irq(int irq);
void unmask_irq(int irq);