diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/dts/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/dts/tegra210-e2220-1170.dts | 63 | ||||
-rw-r--r-- | arch/arm/lib/bootm.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-tegra/tegra210/Kconfig | 9 | ||||
-rw-r--r-- | arch/sandbox/dts/test.dts | 23 | ||||
-rw-r--r-- | arch/sandbox/include/asm/scmi_test.h | 25 | ||||
-rw-r--r-- | arch/x86/cpu/qemu/cpu.c | 9 | ||||
-rw-r--r-- | arch/x86/cpu/qemu/qemu.c | 49 | ||||
-rw-r--r-- | arch/x86/cpu/qfw_cpu.c | 11 |
9 files changed, 69 insertions, 128 deletions
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index d290c44257c..b58f8414726 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -201,7 +201,6 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ tegra124-venice2.dtb \ tegra186-p2771-0000-000.dtb \ tegra186-p2771-0000-500.dtb \ - tegra210-e2220-1170.dtb \ tegra210-p2371-0000.dtb \ tegra210-p2371-2180.dtb \ tegra210-p2571.dtb \ diff --git a/arch/arm/dts/tegra210-e2220-1170.dts b/arch/arm/dts/tegra210-e2220-1170.dts deleted file mode 100644 index e6b06862d8b..00000000000 --- a/arch/arm/dts/tegra210-e2220-1170.dts +++ /dev/null @@ -1,63 +0,0 @@ -/dts-v1/; - -#include "tegra210.dtsi" - -/ { - model = "NVIDIA E2220-1170"; - compatible = "nvidia,e2220-1170", "nvidia,tegra210"; - - chosen { - stdout-path = &uarta; - }; - - aliases { - i2c0 = "/i2c@7000d000"; - mmc0 = "/sdhci@700b0600"; - mmc1 = "/sdhci@700b0000"; - usb0 = "/usb@7d000000"; - }; - - memory { - reg = <0x0 0x80000000 0x0 0xc0000000>; - }; - - sdhci@700b0000 { - status = "okay"; - cd-gpios = <&gpio TEGRA_GPIO(Z, 1) GPIO_ACTIVE_LOW>; - power-gpios = <&gpio TEGRA_GPIO(Z, 4) GPIO_ACTIVE_HIGH>; - bus-width = <4>; - }; - - sdhci@700b0600 { - status = "okay"; - bus-width = <8>; - non-removable; - }; - - i2c@7000d000 { - status = "okay"; - clock-frequency = <400000>; - }; - - usb@7d000000 { - status = "okay"; - dr_mode = "peripheral"; - }; - - clocks { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <0>; - - clk32k_in: clock@0 { - compatible = "fixed-clock"; - reg = <0>; - #clock-cells = <0>; - clock-frequency = <32768>; - }; - }; -}; - -&uarta { - status = "okay"; -}; diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 11af9e2fb9c..f60ee3a7e6a 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -16,7 +16,6 @@ #include <command.h> #include <cpu_func.h> #include <dm.h> -#include <hang.h> #include <lmb.h> #include <log.h> #include <asm/global_data.h> @@ -249,8 +248,7 @@ static void boot_prep_linux(bootm_headers_t *images) #ifdef CONFIG_OF_LIBFDT debug("using: FDT\n"); if (image_setup_linux(images)) { - printf("FDT creation failed! hanging..."); - hang(); + panic("FDT creation failed!"); } #endif } else if (BOOTM_ENABLE_TAGS) { @@ -283,8 +281,7 @@ static void boot_prep_linux(bootm_headers_t *images) setup_board_tags(¶ms); setup_end_tag(gd->bd); } else { - printf("FDT and ATAGS support not compiled in - hanging\n"); - hang(); + panic("FDT and ATAGS support not compiled in\n"); } board_prep_linux(images); diff --git a/arch/arm/mach-tegra/tegra210/Kconfig b/arch/arm/mach-tegra/tegra210/Kconfig index 97ed8e05f43..17f18cbf302 100644 --- a/arch/arm/mach-tegra/tegra210/Kconfig +++ b/arch/arm/mach-tegra/tegra210/Kconfig @@ -3,14 +3,6 @@ if TEGRA210 choice prompt "Tegra210 board select" -config TARGET_E2220_1170 - bool "NVIDIA Tegra210 E2220-1170 board" - select BOARD_LATE_INIT - help - E2220-1170 is a Tegra210 bringup board with onboard SoC, DRAM, - eMMC, SD card slot, HDMI, USB micro-B port, and sockets for various - expansion modules. - config TARGET_P2371_0000 bool "NVIDIA Tegra210 P2371-0000 board" select BOARD_LATE_INIT @@ -46,7 +38,6 @@ endchoice config SYS_SOC default "tegra210" -source "board/nvidia/e2220-1170/Kconfig" source "board/nvidia/p2371-0000/Kconfig" source "board/nvidia/p2371-2180/Kconfig" source "board/nvidia/p2571/Kconfig" diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 899e75f260c..8c4c2bfddd9 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -497,6 +497,27 @@ reg = <0x16>; #reset-cells = <1>; }; + + protocol@17 { + reg = <0x17>; + + regulators { + #address-cells = <1>; + #size-cells = <0>; + + regul0_scmi0: reg@0 { + reg = <0>; + regulator-name = "sandbox-voltd0"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <3300000>; + }; + regul1_scmi0: reg@1 { + reg = <0x1>; + regulator-name = "sandbox-voltd1"; + regulator-min-microvolt = <1800000>; + }; + }; + }; }; sandbox-scmi-agent@1 { @@ -1264,6 +1285,8 @@ compatible = "sandbox,scmi-devices"; clocks = <&clk_scmi0 7>, <&clk_scmi0 3>, <&clk_scmi1 1>; resets = <&reset_scmi0 3>; + regul0-supply = <®ul0_scmi0>; + regul1-supply = <®ul1_scmi0>; }; pinctrl { diff --git a/arch/sandbox/include/asm/scmi_test.h b/arch/sandbox/include/asm/scmi_test.h index 3e8b0068fd4..2930e686d72 100644 --- a/arch/sandbox/include/asm/scmi_test.h +++ b/arch/sandbox/include/asm/scmi_test.h @@ -24,6 +24,7 @@ struct sandbox_scmi_clk { /** * struct sandbox_scmi_reset - Simulated reset controller exposed by SCMI + * @id: Identifier of the reset controller used in the SCMI protocol * @asserted: Reset control state: true if asserted, false if desasserted */ struct sandbox_scmi_reset { @@ -32,12 +33,26 @@ struct sandbox_scmi_reset { }; /** + * struct sandbox_scmi_voltd - Simulated voltage regulator exposed by SCMI + * @id: Identifier of the voltage domain used in the SCMI protocol + * @enabled: Regulator state: true if on, false if off + * @voltage_uv: Regulator current voltage in microvoltd (uV) + */ +struct sandbox_scmi_voltd { + uint id; + bool enabled; + int voltage_uv; +}; + +/** * struct sandbox_scmi_agent - Simulated SCMI service seen by SCMI agent * @idx: Identifier for the SCMI agent, its index * @clk: Simulated clocks * @clk_count: Simulated clocks array size - * @clk: Simulated reset domains - * @clk_count: Simulated reset domains array size + * @reset: Simulated reset domains + * @reset_count: Simulated reset domains array size + * @voltd: Simulated voltage domains (regulators) + * @voltd_count: Simulated voltage domains array size */ struct sandbox_scmi_agent { uint idx; @@ -45,6 +60,8 @@ struct sandbox_scmi_agent { size_t clk_count; struct sandbox_scmi_reset *reset; size_t reset_count; + struct sandbox_scmi_voltd *voltd; + size_t voltd_count; }; /** @@ -63,12 +80,16 @@ struct sandbox_scmi_service { * @clk_count: Number of clock devices probed * @reset: Array the reset controller devices * @reset_count: Number of reset controller devices probed + * @regul: Array regulator devices + * @regul_count: Number of regulator devices probed */ struct sandbox_scmi_devices { struct clk *clk; size_t clk_count; struct reset_ctl *reset; size_t reset_count; + struct udevice **regul; + size_t regul_count; }; #ifdef CONFIG_SCMI_FIRMWARE diff --git a/arch/x86/cpu/qemu/cpu.c b/arch/x86/cpu/qemu/cpu.c index 9ce86b379c4..735b6560843 100644 --- a/arch/x86/cpu/qemu/cpu.c +++ b/arch/x86/cpu/qemu/cpu.c @@ -22,7 +22,14 @@ int cpu_qemu_get_desc(const struct udevice *dev, char *buf, int size) static int cpu_qemu_get_count(const struct udevice *dev) { - return qemu_fwcfg_online_cpus(); + int ret; + struct udevice *qfw_dev; + + ret = qfw_get_dev(&qfw_dev); + if (ret) + return ret; + + return qfw_online_cpus(qfw_dev); } static const struct cpu_ops cpu_qemu_ops = { diff --git a/arch/x86/cpu/qemu/qemu.c b/arch/x86/cpu/qemu/qemu.c index 044a429c13f..e54082df7f9 100644 --- a/arch/x86/cpu/qemu/qemu.c +++ b/arch/x86/cpu/qemu/qemu.c @@ -8,6 +8,7 @@ #include <init.h> #include <pci.h> #include <qfw.h> +#include <dm/platdata.h> #include <asm/irq.h> #include <asm/post.h> #include <asm/processor.h> @@ -16,47 +17,9 @@ static bool i440fx; -#ifdef CONFIG_QFW - -/* on x86, the qfw registers are all IO ports */ -#define FW_CONTROL_PORT 0x510 -#define FW_DATA_PORT 0x511 -#define FW_DMA_PORT_LOW 0x514 -#define FW_DMA_PORT_HIGH 0x518 - -static void qemu_x86_fwcfg_read_entry_pio(uint16_t entry, - uint32_t size, void *address) -{ - uint32_t i = 0; - uint8_t *data = address; - - /* - * writting FW_CFG_INVALID will cause read operation to resume at - * last offset, otherwise read will start at offset 0 - * - * Note: on platform where the control register is IO port, the - * endianness is little endian. - */ - if (entry != FW_CFG_INVALID) - outw(cpu_to_le16(entry), FW_CONTROL_PORT); - - /* the endianness of data register is string-preserving */ - while (size--) - data[i++] = inb(FW_DATA_PORT); -} - -static void qemu_x86_fwcfg_read_entry_dma(struct fw_cfg_dma_access *dma) -{ - /* the DMA address register is big endian */ - outl(cpu_to_be32((uintptr_t)dma), FW_DMA_PORT_HIGH); - - while (be32_to_cpu(dma->control) & ~FW_CFG_DMA_ERROR) - __asm__ __volatile__ ("pause"); -} - -static struct fw_cfg_arch_ops fwcfg_x86_ops = { - .arch_read_pio = qemu_x86_fwcfg_read_entry_pio, - .arch_read_dma = qemu_x86_fwcfg_read_entry_dma +#if CONFIG_IS_ENABLED(QFW_PIO) +U_BOOT_DRVINFO(x86_qfw_pio) = { + .name = "qfw_pio", }; #endif @@ -132,10 +95,6 @@ static void qemu_chipset_init(void) enable_pm_ich9(); } - -#ifdef CONFIG_QFW - qemu_fwcfg_init(&fwcfg_x86_ops); -#endif } #if !CONFIG_IS_ENABLED(SPL_X86_32BIT_INIT) diff --git a/arch/x86/cpu/qfw_cpu.c b/arch/x86/cpu/qfw_cpu.c index b959eadddef..ee00b8fe732 100644 --- a/arch/x86/cpu/qfw_cpu.c +++ b/arch/x86/cpu/qfw_cpu.c @@ -18,7 +18,7 @@ int qemu_cpu_fixup(void) int cpu_num; int cpu_online; struct uclass *uc; - struct udevice *dev, *pdev; + struct udevice *dev, *pdev, *qfwdev; struct cpu_plat *plat; char *cpu; @@ -39,6 +39,13 @@ int qemu_cpu_fixup(void) return -ENODEV; } + /* get qfw dev */ + ret = qfw_get_dev(&qfwdev); + if (ret) { + printf("unable to find qfw device\n"); + return ret; + } + /* calculate cpus that are already bound */ cpu_num = 0; for (uclass_find_first_device(UCLASS_CPU, &dev); @@ -48,7 +55,7 @@ int qemu_cpu_fixup(void) } /* get actual cpu number */ - cpu_online = qemu_fwcfg_online_cpus(); + cpu_online = qfw_online_cpus(qfwdev); if (cpu_online < 0) { printf("unable to get online cpu number: %d\n", cpu_online); return cpu_online; |