diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sandbox/config.mk | 5 | ||||
-rw-r--r-- | arch/sandbox/cpu/spl.c | 3 | ||||
-rw-r--r-- | arch/sandbox/cpu/state.c | 1 | ||||
-rw-r--r-- | arch/sandbox/dts/sandbox.dts | 336 | ||||
-rw-r--r-- | arch/sandbox/dts/sandbox.dtsi | 364 | ||||
-rw-r--r-- | arch/sandbox/dts/sandbox64.dts | 275 | ||||
-rw-r--r-- | arch/sandbox/dts/test.dts | 8 | ||||
-rw-r--r-- | arch/sandbox/include/asm/test.h | 13 | ||||
-rw-r--r-- | arch/x86/include/asm/coreboot_tables.h | 2 |
9 files changed, 408 insertions, 599 deletions
diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index 31a12db103..05fbbd7bcc 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -5,14 +5,15 @@ PLATFORM_CPPFLAGS += -D__SANDBOX__ -U_FORTIFY_SOURCE PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM PLATFORM_CPPFLAGS += -fPIC PLATFORM_LIBS += -lrt +SDL_CONFIG ?= sdl-config # Define this to avoid linking with SDL, which requires SDL libraries # This can solve 'sdl-config: Command not found' errors ifneq ($(NO_SDL),) PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL else -PLATFORM_LIBS += $(shell sdl-config --libs) -PLATFORM_CPPFLAGS += $(shell sdl-config --cflags) +PLATFORM_LIBS += $(shell $(SDL_CONFIG) --libs) +PLATFORM_CPPFLAGS += $(shell $(SDL_CONFIG) --cflags) endif cmd_u-boot__ = $(CC) -o $@ -Wl,-T u-boot.lds $(u-boot-init) \ diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c index 2ca4cd6e35..4f415c71d6 100644 --- a/arch/sandbox/cpu/spl.c +++ b/arch/sandbox/cpu/spl.c @@ -12,6 +12,7 @@ DECLARE_GLOBAL_DATA_PTR; +/* SPL / TPL init function */ void board_init_f(ulong flag) { struct sandbox_state *state = state_get_current(); @@ -44,7 +45,7 @@ static int spl_board_load_image(struct spl_image_info *spl_image, return 0; } -SPL_LOAD_IMAGE_METHOD("sandbox", 0, BOOT_DEVICE_BOARD, spl_board_load_image); +SPL_LOAD_IMAGE_METHOD("sandbox", 9, BOOT_DEVICE_BOARD, spl_board_load_image); void spl_board_init(void) { diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index d3b9c05985..2333240fda 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -356,6 +356,7 @@ void state_reset_for_test(struct sandbox_state *state) /* No reset yet, so mark it as such. Always allow power reset */ state->last_sysreset = SYSRESET_COUNT; state->sysreset_allowed[SYSRESET_POWER] = true; + state->sysreset_allowed[SYSRESET_POWER_OFF] = true; memset(&state->wdt, '\0', sizeof(state->wdt)); memset(state->spi, '\0', sizeof(state->spi)); diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts index a41b5f052d..16a33db87d 100644 --- a/arch/sandbox/dts/sandbox.dts +++ b/arch/sandbox/dts/sandbox.dts @@ -1,6 +1,6 @@ /dts-v1/; -#define USB_CLASS_HUB 9 +#include <config.h> / { #address-cells = <1>; @@ -12,46 +12,17 @@ pci0 = &pci; rtc0 = &rtc_0; axi0 = &axi; + spi0 = &spi; }; - chosen { - stdout-path = "/serial"; - }; - - audio: audio-codec { - compatible = "sandbox,audio-codec"; - #sound-dai-cells = <1>; + memory { + reg = <0 CONFIG_SYS_SDRAM_SIZE>; }; cros_ec: cros-ec { reg = <0 0>; u-boot,dm-pre-reloc; compatible = "google,cros-ec-sandbox"; - - /* - * This describes the flash memory within the EC. Note - * that the STM32L flash erases to 0, not 0xff. - */ - flash { - u-boot,dm-pre-reloc; - image-pos = <0x08000000>; - size = <0x20000>; - erase-value = <0>; - - /* Information for sandbox */ - ro { - image-pos = <0>; - size = <0xf000>; - }; - wp-ro { - image-pos = <0xf000>; - size = <0x1000>; - }; - rw { - image-pos = <0x10000>; - size = <0x10000>; - }; - }; }; ethrawbus { @@ -65,30 +36,6 @@ fake-host-hwaddr = [00 00 66 44 22 00]; }; - gpio_a: gpios@0 { - u-boot,dm-pre-reloc; - gpio-controller; - compatible = "sandbox,gpio"; - #gpio-cells = <1>; - gpio-bank-name = "a"; - sandbox,gpio-count = <20>; - }; - - gpio_b: gpios@1 { - u-boot,dm-pre-reloc; - gpio-controller; - compatible = "sandbox,gpio"; - #gpio-cells = <2>; - gpio-bank-name = "b"; - sandbox,gpio-count = <10>; - }; - - hexagon { - compatible = "demo-simple"; - colour = "white"; - sides = <6>; - }; - i2c_0: i2c@0 { #address-cells = <1>; #size-cells = <0>; @@ -97,63 +44,6 @@ clock-frequency = <400000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c0>; - eeprom@2c { - reg = <0x2c>; - compatible = "i2c-eeprom"; - sandbox,emul = <&emul_eeprom>; - }; - - rtc_0: rtc@43 { - reg = <0x43>; - compatible = "sandbox-rtc"; - sandbox,emul = <&emul0>; - }; - sandbox_pmic: sandbox_pmic { - reg = <0x40>; - }; - - mc34708: pmic@41 { - reg = <0x41>; - }; - - i2c_emul: emul { - reg = <0xff>; - compatible = "sandbox,i2c-emul-parent"; - emul_eeprom: emul-eeprom { - compatible = "sandbox,i2c-eeprom"; - sandbox,filename = "i2c.bin"; - sandbox,size = <256>; - }; - emul0: emul0 { - compatible = "sandbox,i2c-rtc"; - }; - }; - }; - - i2s: i2s { - compatible = "sandbox,i2s"; - #sound-dai-cells = <1>; - }; - - lcd { - u-boot,dm-pre-reloc; - compatible = "sandbox,lcd-sdl"; - xres = <1366>; - yres = <768>; - }; - - leds { - compatible = "gpio-leds"; - - iracibble { - gpios = <&gpio_a 1 0>; - label = "sandbox:red"; - }; - - martinet { - gpios = <&gpio_a 2 0>; - label = "sandbox:green"; - }; }; pci: pci-controller { @@ -163,233 +53,19 @@ #size-cells = <2>; ranges = <0x02000000 0 0x10000000 0x10000000 0 0x2000 0x01000000 0 0x20000000 0x20000000 0 0x2000>; - pci@1f,0 { - compatible = "pci-generic"; - reg = <0xf800 0 0 0 0>; - emul@1f,0 { - compatible = "sandbox,swap-case"; - }; - }; - }; - - pinctrl { - compatible = "sandbox,pinctrl"; - status = "okay"; - - pinctrl_i2c0: i2c0 { - groups = "i2c"; - function = "i2c"; - bias-pull-up; - }; - - pinctrl_serial0: uart0 { - groups = "serial_a"; - function = "serial"; - }; - - pinctrl_onewire0: onewire0 { - groups = "w1"; - function = "w1"; - bias-pull-up; - }; - }; - - reset@1 { - compatible = "sandbox,reset"; }; - sound { - compatible = "sandbox,sound"; - cpu { - sound-dai = <&i2s 0>; - }; - - codec { - sound-dai = <&audio 0>; - }; - }; - - spi@0 { + spi: spi@0 { u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <0>; reg = <0 0>; compatible = "sandbox,spi"; cs-gpios = <0>, <&gpio_a 0>; - firmware_storage_spi: flash@0 { - u-boot,dm-pre-reloc; - reg = <0>; - compatible = "spansion,m25p16", "sandbox,spi-flash"; - spi-max-frequency = <40000000>; - sandbox,filename = "spi.bin"; - }; - }; - - spl-test { - u-boot,dm-pre-reloc; - compatible = "sandbox,spl-test"; - boolval; - intval = <1>; - intarray = <2 3 4>; - byteval = [05]; - bytearray = [06]; - longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11]; - stringval = "message"; - stringarray = "multi-word", "message"; - }; - - spl-test2 { - u-boot,dm-pre-reloc; - compatible = "sandbox,spl-test"; - intval = <3>; - intarray = <5>; - byteval = [08]; - bytearray = [01 23 34]; - longbytearray = [09 0a 0b 0c]; - stringval = "message2"; - stringarray = "another", "multi-word", "message"; }; - spl-test3 { - u-boot,dm-pre-reloc; - compatible = "sandbox,spl-test"; - stringarray = "one"; - }; - - spl-test4 { - u-boot,dm-pre-reloc; - compatible = "sandbox,spl-test.2"; - }; - - square { - compatible = "demo-shape"; - colour = "blue"; - sides = <4>; - }; - - timer { - compatible = "sandbox,timer"; - clock-frequency = <1000000>; - }; - - tpm { - u-boot,dm-pre-reloc; - compatible = "google,sandbox-tpm"; - }; - - tpm2 { - compatible = "sandbox,tpm2"; - }; - - triangle { - compatible = "demo-shape"; - colour = "cyan"; - sides = <3>; - character = <83>; - light-gpios = <&gpio_a 2>, <&gpio_b 6 0>; - }; - - /* Needs to be available prior to relocation */ - uart0: serial { - u-boot,dm-spl; - compatible = "sandbox,serial"; - sandbox,text-colour = "cyan"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_serial0>; - }; - - usb@0 { - compatible = "sandbox,usb"; - status = "disabled"; - hub { - compatible = "sandbox,usb-hub"; - #address-cells = <1>; - #size-cells = <0>; - flash-stick { - reg = <0>; - compatible = "sandbox,usb-flash"; - }; - }; - }; - - usb@1 { - compatible = "sandbox,usb"; - hub { - compatible = "usb-hub"; - usb,device-class = <USB_CLASS_HUB>; - hub-emul { - compatible = "sandbox,usb-hub"; - #address-cells = <1>; - #size-cells = <0>; - flash-stick { - reg = <0>; - compatible = "sandbox,usb-flash"; - sandbox,filepath = "flash.bin"; - }; - }; - }; - }; - - usb@2 { - compatible = "sandbox,usb"; - status = "disabled"; - }; - - spmi: spmi@0 { - compatible = "sandbox,spmi"; - #address-cells = <0x1>; - #size-cells = <0x1>; - pm8916@0 { - compatible = "qcom,spmi-pmic"; - reg = <0x0 0x1>; - #address-cells = <0x1>; - #size-cells = <0x1>; - - spmi_gpios: gpios@c000 { - compatible = "qcom,pm8916-gpio"; - reg = <0xc000 0x400>; - gpio-controller; - gpio-count = <4>; - #gpio-cells = <2>; - gpio-bank-name="spmi"; - }; - }; - }; - - axi: axi@0 { - compatible = "sandbox,axi"; - #address-cells = <0x1>; - #size-cells = <0x1>; - store@0 { - compatible = "sandbox,sandbox_store"; - reg = <0x0 0x400>; - }; - }; - - onewire0: onewire { - compatible = "w1-gpio"; - gpios = <&gpio_a 8>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_onewire0>; - status = "okay"; - - sandbox_eeprom0: sandbox_eeprom@0 { - compatible = "sandbox,w1-eeprom"; - status = "okay"; - }; - }; - - sandbox_tee { - compatible = "sandbox,tee"; - }; }; +#include "sandbox.dtsi" #include "cros-ec-keyboard.dtsi" #include "sandbox_pmic.dtsi" - -&cros_ec { - u-boot,dm-pre-reloc; - keyboard-controller { - u-boot,dm-pre-reloc; - }; -}; diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi new file mode 100644 index 0000000000..c6d5650c20 --- /dev/null +++ b/arch/sandbox/dts/sandbox.dtsi @@ -0,0 +1,364 @@ +/* + * This is the common sandbox device-tree nodes. This is shared between sandbox + * and sandbox64 builds. + */ + +#define USB_CLASS_HUB 9 + +/ { + chosen { + stdout-path = "/serial"; + }; + + audio: audio-codec { + compatible = "sandbox,audio-codec"; + #sound-dai-cells = <1>; + }; + + gpio_a: gpios@0 { + u-boot,dm-pre-reloc; + gpio-controller; + compatible = "sandbox,gpio"; + #gpio-cells = <1>; + gpio-bank-name = "a"; + sandbox,gpio-count = <20>; + }; + + gpio_b: gpios@1 { + u-boot,dm-pre-reloc; + gpio-controller; + compatible = "sandbox,gpio"; + #gpio-cells = <2>; + gpio-bank-name = "b"; + sandbox,gpio-count = <10>; + }; + + hexagon { + compatible = "demo-simple"; + colour = "white"; + sides = <6>; + }; + + i2c_0: i2c@0 { + eeprom@2c { + reg = <0x2c>; + compatible = "i2c-eeprom"; + sandbox,emul = <&emul_eeprom>; + }; + + rtc_0: rtc@43 { + reg = <0x43>; + compatible = "sandbox-rtc"; + sandbox,emul = <&emul0>; + }; + sandbox_pmic: sandbox_pmic { + reg = <0x40>; + }; + + mc34708: pmic@41 { + reg = <0x41>; + }; + + i2c_emul: emul { + reg = <0xff>; + compatible = "sandbox,i2c-emul-parent"; + emul_eeprom: emul-eeprom { + compatible = "sandbox,i2c-eeprom"; + sandbox,filename = "i2c.bin"; + sandbox,size = <256>; + }; + emul0: emul0 { + compatible = "sandbox,i2c-rtc"; + }; + }; + }; + + i2s: i2s { + compatible = "sandbox,i2s"; + #sound-dai-cells = <1>; + }; + + lcd { + u-boot,dm-pre-reloc; + compatible = "sandbox,lcd-sdl"; + xres = <1366>; + yres = <768>; + }; + + leds { + compatible = "gpio-leds"; + + iracibble { + gpios = <&gpio_a 1 0>; + label = "sandbox:red"; + }; + + martinet { + gpios = <&gpio_a 2 0>; + label = "sandbox:green"; + }; + }; + + pci-controller { + pci@1f,0 { + compatible = "pci-generic"; + reg = <0xf800 0 0 0 0>; + emul@1f,0 { + compatible = "sandbox,swap-case"; + }; + }; + }; + + pinctrl { + compatible = "sandbox,pinctrl"; + status = "okay"; + + pinctrl_i2c0: i2c0 { + groups = "i2c"; + function = "i2c"; + bias-pull-up; + }; + + pinctrl_serial0: uart0 { + groups = "serial_a"; + function = "serial"; + }; + + pinctrl_onewire0: onewire0 { + groups = "w1"; + function = "w1"; + bias-pull-up; + }; + }; + + reset@1 { + compatible = "sandbox,reset"; + }; + + sound { + compatible = "sandbox,sound"; + cpu { + sound-dai = <&i2s 0>; + }; + + codec { + sound-dai = <&audio 0>; + }; + }; + + spi@0 { + firmware_storage_spi: flash@0 { + u-boot,dm-pre-reloc; + reg = <0>; + compatible = "spansion,m25p16", "jedec,spi-nor"; + spi-max-frequency = <40000000>; + sandbox,filename = "spi.bin"; + }; + }; + + spl-test { + u-boot,dm-pre-reloc; + compatible = "sandbox,spl-test"; + boolval; + intval = <1>; + intarray = <2 3 4>; + byteval = [05]; + bytearray = [06]; + longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11]; + stringval = "message"; + stringarray = "multi-word", "message"; + }; + + spl-test2 { + u-boot,dm-pre-reloc; + compatible = "sandbox,spl-test"; + intval = <3>; + intarray = <5>; + byteval = [08]; + bytearray = [01 23 34]; + longbytearray = [09 0a 0b 0c]; + stringval = "message2"; + stringarray = "another", "multi-word", "message"; + }; + + spl-test3 { + u-boot,dm-pre-reloc; + compatible = "sandbox,spl-test"; + stringarray = "one"; + }; + + spl-test4 { + u-boot,dm-pre-reloc; + compatible = "sandbox,spl-test.2"; + }; + + spl-test5 { + u-boot,dm-tpl; + compatible = "sandbox,spl-test"; + stringarray = "tpl"; + }; + + spl-test6 { + u-boot,dm-pre-proper; + compatible = "sandbox,spl-test"; + stringarray = "pre-proper"; + }; + + spl-test7 { + u-boot,dm-spl; + compatible = "sandbox,spl-test"; + stringarray = "spl"; + }; + + square { + compatible = "demo-shape"; + colour = "blue"; + sides = <4>; + }; + + timer { + compatible = "sandbox,timer"; + clock-frequency = <1000000>; + }; + + tpm { + u-boot,dm-pre-reloc; + compatible = "google,sandbox-tpm"; + }; + + tpm2 { + compatible = "sandbox,tpm2"; + }; + + triangle { + compatible = "demo-shape"; + colour = "cyan"; + sides = <3>; + character = <83>; + light-gpios = <&gpio_a 2>, <&gpio_b 6 0>; + }; + + /* Needs to be available prior to relocation */ + uart0: serial { + u-boot,dm-spl; + compatible = "sandbox,serial"; + sandbox,text-colour = "cyan"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_serial0>; + }; + + usb@0 { + compatible = "sandbox,usb"; + status = "disabled"; + hub { + compatible = "sandbox,usb-hub"; + #address-cells = <1>; + #size-cells = <0>; + flash-stick { + reg = <0>; + compatible = "sandbox,usb-flash"; + }; + }; + }; + + usb@1 { + compatible = "sandbox,usb"; + hub { + compatible = "usb-hub"; + usb,device-class = <USB_CLASS_HUB>; + hub-emul { + compatible = "sandbox,usb-hub"; + #address-cells = <1>; + #size-cells = <0>; + flash-stick { + reg = <0>; + compatible = "sandbox,usb-flash"; + sandbox,filepath = "flash.bin"; + }; + }; + }; + }; + + usb@2 { + compatible = "sandbox,usb"; + status = "disabled"; + }; + + spmi: spmi@0 { + compatible = "sandbox,spmi"; + #address-cells = <0x1>; + #size-cells = <0x1>; + pm8916@0 { + compatible = "qcom,spmi-pmic"; + reg = <0x0 0x1>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + spmi_gpios: gpios@c000 { + compatible = "qcom,pm8916-gpio"; + reg = <0xc000 0x400>; + gpio-controller; + gpio-count = <4>; + #gpio-cells = <2>; + gpio-bank-name="spmi"; + }; + }; + }; + + axi: axi@0 { + compatible = "sandbox,axi"; + #address-cells = <0x1>; + #size-cells = <0x1>; + store@0 { + compatible = "sandbox,sandbox_store"; + reg = <0x0 0x400>; + }; + }; + + onewire0: onewire { + compatible = "w1-gpio"; + gpios = <&gpio_a 8>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_onewire0>; + status = "okay"; + + sandbox_eeprom0: sandbox_eeprom@0 { + compatible = "sandbox,w1-eeprom"; + status = "okay"; + }; + }; + + sandbox_tee { + compatible = "sandbox,tee"; + }; +}; + +&cros_ec { + /* + * This describes the flash memory within the EC. Note + * that the STM32L flash erases to 0, not 0xff. + */ + flash { + image-pos = <0x08000000>; + size = <0x20000>; + erase-value = <0>; + + /* Information for sandbox */ + ro { + image-pos = <0>; + size = <0xf000>; + }; + wp-ro { + image-pos = <0xf000>; + size = <0x1000>; + }; + rw { + image-pos = <0x10000>; + size = <0x10000>; + }; + }; + + keyboard-controller { + u-boot,dm-pre-reloc; + }; +}; diff --git a/arch/sandbox/dts/sandbox64.dts b/arch/sandbox/dts/sandbox64.dts index a3c95f2cdb..37a5539ff4 100644 --- a/arch/sandbox/dts/sandbox64.dts +++ b/arch/sandbox/dts/sandbox64.dts @@ -1,6 +1,6 @@ /dts-v1/; -#define USB_CLASS_HUB 9 +#include <config.h> / { #address-cells = <2>; @@ -11,39 +11,18 @@ i2c0 = &i2c_0; pci0 = &pci; rtc0 = &rtc_0; + axi0 = &axi; + spi0 = &spi; }; - chosen { - stdout-path = "/serial"; + memory { + reg = /bits/ 64 <0 CONFIG_SYS_SDRAM_SIZE>; }; cros_ec: cros-ec { reg = <0 0 0 0>; + u-boot,dm-pre-reloc; compatible = "google,cros-ec-sandbox"; - - /* - * This describes the flash memory within the EC. Note - * that the STM32L flash erases to 0, not 0xff. - */ - flash { - image-pos = <0x08000000>; - size = <0x20000>; - erase-value = <0>; - - /* Information for sandbox */ - ro { - image-pos = <0>; - size = <0xf000>; - }; - wp-ro { - image-pos = <0xf000>; - size = <0x1000>; - }; - rw { - image-pos = <0x10000>; - size = <0x10000>; - }; - }; }; ethrawbus { @@ -57,28 +36,6 @@ fake-host-hwaddr = [00 00 66 44 22 00]; }; - gpio_a: gpios@0 { - gpio-controller; - compatible = "sandbox,gpio"; - #gpio-cells = <1>; - gpio-bank-name = "a"; - sandbox,gpio-count = <20>; - }; - - gpio_b: gpios@1 { - gpio-controller; - compatible = "sandbox,gpio"; - #gpio-cells = <2>; - gpio-bank-name = "b"; - sandbox,gpio-count = <10>; - }; - - hexagon { - compatible = "demo-simple"; - colour = "white"; - sides = <6>; - }; - i2c_0: i2c@0 { #address-cells = <1>; #size-cells = <0>; @@ -87,58 +44,6 @@ clock-frequency = <400000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c0>; - eeprom@2c { - reg = <0x2c>; - compatible = "i2c-eeprom"; - sandbox,emul = <&emul_eeprom>; - }; - - rtc_0: rtc@43 { - reg = <0x43>; - compatible = "sandbox-rtc"; - sandbox,emul = <&emul0>; - }; - sandbox_pmic: sandbox_pmic { - reg = <0x40>; - }; - - mc34708: pmic@41 { - reg = <0x41>; - }; - - i2c_emul: emul { - reg = <0xff>; - compatible = "sandbox,i2c-emul-parent"; - emul_eeprom: emul-eeprom { - compatible = "sandbox,i2c-eeprom"; - sandbox,filename = "i2c.bin"; - sandbox,size = <256>; - }; - emul0: emul0 { - compatible = "sandbox,i2c-rtc"; - }; - }; - }; - - lcd { - u-boot,dm-pre-reloc; - compatible = "sandbox,lcd-sdl"; - xres = <1366>; - yres = <768>; - }; - - leds { - compatible = "gpio-leds"; - - iracibble { - gpios = <&gpio_a 1 0>; - label = "sandbox:red"; - }; - - martinet { - gpios = <&gpio_a 2 0>; - label = "sandbox:green"; - }; }; pci: pci-controller { @@ -148,181 +53,19 @@ #size-cells = <2>; ranges = <0x02000000 0 0x10000000 0 0x10000000 0 0x2000 0x01000000 0 0x20000000 0 0x20000000 0 0x2000>; - pci@1f,0 { - compatible = "pci-generic"; - reg = <0xf800 0 0 0 0>; - emul@1f,0 { - compatible = "sandbox,swap-case"; - }; - }; - }; - - pinctrl { - compatible = "sandbox,pinctrl"; - - pinctrl_i2c0: i2c0 { - groups = "i2c"; - function = "i2c"; - bias-pull-up; - }; - - pinctrl_serial0: uart0 { - groups = "serial_a"; - function = "serial"; - }; }; - reset@1 { - compatible = "sandbox,reset"; - }; - - spi@0 { + spi: spi@0 { + u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <0>; reg = <0 0 0 0>; compatible = "sandbox,spi"; cs-gpios = <0>, <&gpio_a 0>; - firmware_storage_spi: flash@0 { - reg = <0>; - compatible = "spansion,m25p16", "sandbox,spi-flash"; - spi-max-frequency = <40000000>; - sandbox,filename = "spi.bin"; - }; }; - spl-test { - u-boot,dm-pre-reloc; - compatible = "sandbox,spl-test"; - boolval; - intval = <1>; - intarray = <2 3 4>; - byteval = [05]; - bytearray = [06]; - longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11]; - stringval = "message"; - stringarray = "multi-word", "message"; - }; - - spl-test2 { - u-boot,dm-pre-reloc; - compatible = "sandbox,spl-test"; - intval = <3>; - intarray = <5>; - byteval = [08]; - bytearray = [01 23 34]; - longbytearray = [09 0a 0b 0c]; - stringval = "message2"; - stringarray = "another", "multi-word", "message"; - }; - - spl-test3 { - u-boot,dm-pre-reloc; - compatible = "sandbox,spl-test"; - stringarray = "one"; - }; - - spl-test4 { - u-boot,dm-pre-reloc; - compatible = "sandbox,spl-test.2"; - }; - - square { - compatible = "demo-shape"; - colour = "blue"; - sides = <4>; - }; - - timer { - compatible = "sandbox,timer"; - clock-frequency = <1000000>; - }; - - tpm { - compatible = "google,sandbox-tpm"; - }; - - tpm2 { - compatible = "sandbox,tpm2"; - }; - - triangle { - compatible = "demo-shape"; - colour = "cyan"; - sides = <3>; - character = <83>; - light-gpios = <&gpio_a 2>, <&gpio_b 6 0>; - }; - - /* Needs to be available prior to relocation */ - uart0: serial { - compatible = "sandbox,serial"; - sandbox,text-colour = "cyan"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_serial0>; - }; - - usb@0 { - compatible = "sandbox,usb"; - status = "disabled"; - hub { - compatible = "sandbox,usb-hub"; - #address-cells = <1>; - #size-cells = <0>; - flash-stick { - reg = <0>; - compatible = "sandbox,usb-flash"; - }; - }; - }; - - usb@1 { - compatible = "sandbox,usb"; - hub { - compatible = "usb-hub"; - usb,device-class = <USB_CLASS_HUB>; - hub-emul { - compatible = "sandbox,usb-hub"; - #address-cells = <1>; - #size-cells = <0>; - flash-stick { - reg = <0>; - compatible = "sandbox,usb-flash"; - sandbox,filepath = "flash.bin"; - }; - }; - }; - }; - - usb@2 { - compatible = "sandbox,usb"; - status = "disabled"; - }; - - spmi: spmi@0 { - compatible = "sandbox,spmi"; - #address-cells = <0x1>; - #size-cells = <0x1>; - pm8916@0 { - compatible = "qcom,spmi-pmic"; - reg = <0x0 0x1>; - #address-cells = <0x1>; - #size-cells = <0x1>; - - spmi_gpios: gpios@c000 { - compatible = "qcom,pm8916-gpio"; - reg = <0xc000 0x400>; - gpio-controller; - gpio-count = <4>; - #gpio-cells = <2>; - gpio-bank-name="spmi"; - }; - }; - }; - - sandbox_tee { - compatible = "sandbox,tee"; - }; }; +#include "sandbox.dtsi" #include "cros-ec-keyboard.dtsi" #include "sandbox_pmic.dtsi" diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index a7a566c0d8..8147d9781e 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -446,6 +446,14 @@ compatible = "sandbox,swap-case"; }; }; + pci@1,0 { + compatible = "pci-generic"; + reg = <0x0800 0 0 0 0>; + emul@0,0 { + compatible = "sandbox,swap-case"; + use-ea; + }; + }; pci@1f,0 { compatible = "pci-generic"; reg = <0xf800 0 0 0 0>; diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index 7ec9b61008..cbf209693d 100644 --- a/arch/sandbox/include/asm/test.h +++ b/arch/sandbox/include/asm/test.h @@ -19,6 +19,7 @@ #define PCI_CAP_ID_PM_OFFSET 0x50 #define PCI_CAP_ID_EXP_OFFSET 0x60 #define PCI_CAP_ID_MSIX_OFFSET 0x70 +#define PCI_CAP_ID_EA_OFFSET 0x80 #define PCI_EXT_CAP_ID_ERR_OFFSET 0x100 #define PCI_EXT_CAP_ID_VC_OFFSET 0x200 @@ -30,6 +31,18 @@ #define SANDBOX_CLK_RATE 32768 +/* Macros used to test PCI EA capability structure */ +#define PCI_CAP_EA_BASE_LO0 0x00100000 +#define PCI_CAP_EA_BASE_LO1 0x00110000 +#define PCI_CAP_EA_BASE_LO2 0x00120000 +#define PCI_CAP_EA_BASE_LO4 0x00140000 +#define PCI_CAP_EA_BASE_HI2 0x00020000ULL +#define PCI_CAP_EA_BASE_HI4 0x00040000ULL +#define PCI_CAP_EA_SIZE_LO 0x0000ffff +#define PCI_CAP_EA_SIZE_HI 0x00000010ULL +#define PCI_EA_BAR2_MAGIC 0x72727272 +#define PCI_EA_BAR4_MAGIC 0x74747474 + /* System controller driver data */ enum { SYSCON0 = 32, diff --git a/arch/x86/include/asm/coreboot_tables.h b/arch/x86/include/asm/coreboot_tables.h index c42175b94d..2c54e24e02 100644 --- a/arch/x86/include/asm/coreboot_tables.h +++ b/arch/x86/include/asm/coreboot_tables.h @@ -8,6 +8,8 @@ #ifndef _COREBOOT_TABLES_H #define _COREBOOT_TABLES_H +struct memory_area; + struct cbuint64 { u32 lo; u32 hi; |