diff options
Diffstat (limited to 'arch/arm')
24 files changed, 534 insertions, 198 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index a8b7bdeaa6..b532d3fe2f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -276,6 +276,7 @@ config ARCH_ARM64_VIRT select SYS_SUPPORTS_64BIT_KERNEL select ARM_AMBA select BOARD_ARM_VIRT + select HW_HAS_PCI endchoice @@ -307,6 +308,7 @@ source "arch/arm/mach-zynqmp/Kconfig" config BOARD_ARM_VIRT bool select BOARD_ARM_GENERIC_DT + select BOARD_QEMU_VIRT select OF_OVERLAY config BOARD_ARM_GENERIC_DT diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile index b7a72d5ba0..50b07462bb 100644 --- a/arch/arm/boards/Makefile +++ b/arch/arm/boards/Makefile @@ -107,6 +107,7 @@ obj-$(CONFIG_MACH_PM9263) += pm9263/ obj-$(CONFIG_MACH_PM9G45) += pm9g45/ obj-$(CONFIG_MACH_PROTONIC_IMX6) += protonic-imx6/ obj-$(CONFIG_MACH_PROTONIC_IMX8M) += protonic-imx8m/ +obj-$(CONFIG_MACH_PROTONIC_STM32MP1) += protonic-stm32mp1/ obj-$(CONFIG_MACH_QIL_A9260) += qil-a926x/ obj-$(CONFIG_MACH_QIL_A9G20) += qil-a926x/ obj-$(CONFIG_MACH_RADXA_ROCK) += radxa-rock/ @@ -166,7 +167,6 @@ obj-$(CONFIG_MACH_ZEDBOARD) += avnet-zedboard/ obj-$(CONFIG_MACH_ZYLONITE) += zylonite/ obj-$(CONFIG_MACH_VARISCITE_MX6) += variscite-mx6/ obj-$(CONFIG_MACH_VSCOM_BALTOS) += vscom-baltos/ -obj-$(CONFIG_BOARD_ARM_VIRT) += qemu-virt/ obj-$(CONFIG_MACH_WARP7) += element14-warp7/ obj-$(CONFIG_MACH_WEBASTO_CCBV2) += webasto-ccbv2/ obj-$(CONFIG_MACH_VF610_TWR) += freescale-vf610-twr/ diff --git a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063.h b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063.h index 9a8f5f18e1..8e0ab6f585 100644 --- a/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063.h +++ b/arch/arm/boards/phytec-som-imx6/flash-header-phytec-pcl063.h @@ -3,6 +3,8 @@ loadaddr 0x80000000 soc imx6 ivtofs 0x400 +wm 32 0x020c8140 0x00580012 + wm 32 0x020c4068 0xffffffff wm 32 0x020c406c 0xffffffff wm 32 0x020c4070 0xffffffff diff --git a/arch/arm/boards/protonic-stm32mp1/Makefile b/arch/arm/boards/protonic-stm32mp1/Makefile new file mode 100644 index 0000000000..092c31d6b2 --- /dev/null +++ b/arch/arm/boards/protonic-stm32mp1/Makefile @@ -0,0 +1,2 @@ +lwl-y += lowlevel.o +obj-y += board.o diff --git a/arch/arm/boards/protonic-stm32mp1/board.c b/arch/arm/boards/protonic-stm32mp1/board.c new file mode 100644 index 0000000000..84a3d8eabc --- /dev/null +++ b/arch/arm/boards/protonic-stm32mp1/board.c @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland +// SPDX-FileCopyrightText: 2021 Oleksij Rempel, Pengutronix + +#include <bootsource.h> +#include <common.h> +#include <init.h> +#include <mach/bbu.h> +#include <of_device.h> + +/* board specific flags */ +#define PRT_STM32_BOOTSRC_SD BIT(2) +#define PRT_STM32_BOOTSRC_EMMC BIT(1) +#define PRT_STM32_BOOTSRC_SPI_NOR BIT(0) + +struct prt_stm32_machine_data { + u32 flags; +}; + +struct prt_stm32_boot_dev { + char *name; + char *env; + char *dev; + int flags; + int boot_idx; + enum bootsource boot_src; +}; + +static const struct prt_stm32_boot_dev prt_stm32_boot_devs[] = { + { + .name = "emmc", + .env = "/chosen/environment-emmc", + .dev = "/dev/mmc1.ssbl", + .flags = PRT_STM32_BOOTSRC_EMMC, + .boot_src = BOOTSOURCE_MMC, + .boot_idx = 1, + }, { + .name = "qspi", + .env = "/chosen/environment-qspi", + .dev = "/dev/flash.ssbl", + .flags = PRT_STM32_BOOTSRC_SPI_NOR, + .boot_src = BOOTSOURCE_SPI_NOR, + .boot_idx = -1, + }, { + /* SD is optional boot source and should be last device in the + * list. */ + .name = "sd", + .env = "/chosen/environment-sd", + .dev = "/dev/mmc0.ssbl", + .flags = PRT_STM32_BOOTSRC_SD, + .boot_src = BOOTSOURCE_MMC, + .boot_idx = 0, + }, +}; + +static int prt_stm32_probe(struct device_d *dev) +{ + const struct prt_stm32_machine_data *dcfg; + char *env_path_back = NULL, *env_path = NULL; + int ret, i; + + dcfg = of_device_get_match_data(dev); + if (!dcfg) { + ret = -EINVAL; + goto exit_get_dcfg; + } + + for (i = 0; i < ARRAY_SIZE(prt_stm32_boot_devs); i++) { + const struct prt_stm32_boot_dev *bd = &prt_stm32_boot_devs[i]; + int bbu_flags = 0; + + /* skip not supported boot sources */ + if (!(bd->flags & dcfg->flags)) + continue; + + /* first device is build-in device */ + if (!env_path_back) + env_path_back = bd->env; + + if (bd->boot_src == bootsource_get() && (bd->boot_idx == -1 || + bd->boot_idx == bootsource_get_instance())) { + bbu_flags = BBU_HANDLER_FLAG_DEFAULT; + env_path = bd->env; + } + + ret = stm32mp_bbu_mmc_register_handler(bd->name, bd->dev, + bbu_flags); + if (ret < 0) + dev_warn(dev, "Failed to enable %s bbu (%pe)\n", + bd->name, ERR_PTR(ret)); + } + + if (!env_path) + env_path = env_path_back; + ret = of_device_enable_path(env_path); + if (ret < 0) + dev_warn(dev, "Failed to enable environment partition '%s' (%pe)\n", + env_path, ERR_PTR(ret)); + + return 0; + +exit_get_dcfg: + dev_err(dev, "Failed to get dcfg: %pe\n", ERR_PTR(ret)); + return ret; +} + +static const struct prt_stm32_machine_data prt_stm32_prtt1a = { + .flags = PRT_STM32_BOOTSRC_SD | PRT_STM32_BOOTSRC_SPI_NOR, +}; + +static const struct prt_stm32_machine_data prt_stm32_prtt1c = { + .flags = PRT_STM32_BOOTSRC_SD | PRT_STM32_BOOTSRC_EMMC, +}; + +static const struct of_device_id prt_stm32_of_match[] = { + { .compatible = "prt,prtt1a", .data = &prt_stm32_prtt1a }, + { .compatible = "prt,prtt1c", .data = &prt_stm32_prtt1c }, + { .compatible = "prt,prtt1s", .data = &prt_stm32_prtt1a }, + { /* sentinel */ }, +}; + +static struct driver_d prt_stm32_board_driver = { + .name = "board-protonic-stm32", + .probe = prt_stm32_probe, + .of_compatible = prt_stm32_of_match, +}; +postcore_platform_driver(prt_stm32_board_driver); diff --git a/arch/arm/boards/protonic-stm32mp1/lowlevel.c b/arch/arm/boards/protonic-stm32mp1/lowlevel.c new file mode 100644 index 0000000000..583f72dfe7 --- /dev/null +++ b/arch/arm/boards/protonic-stm32mp1/lowlevel.c @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland + +#include <common.h> +#include <debug_ll.h> +#include <mach/entry.h> + +extern char __dtb_z_stm32mp151_prtt1a_start[]; +extern char __dtb_z_stm32mp151_prtt1c_start[]; +extern char __dtb_z_stm32mp151_prtt1s_start[]; + +static void setup_uart(void) +{ + /* first stage has set up the UART, so nothing to do here */ + putc_ll('>'); +} + +ENTRY_FUNCTION(start_prtt1a, r0, r1, r2) +{ + void *fdt; + + stm32mp_cpu_lowlevel_init(); + + if (IS_ENABLED(CONFIG_DEBUG_LL)) + setup_uart(); + + fdt = __dtb_z_stm32mp151_prtt1a_start + get_runtime_offset(); + + stm32mp1_barebox_entry(fdt); +} + +ENTRY_FUNCTION(start_prtt1c, r0, r1, r2) +{ + void *fdt; + + stm32mp_cpu_lowlevel_init(); + + if (IS_ENABLED(CONFIG_DEBUG_LL)) + setup_uart(); + + fdt = __dtb_z_stm32mp151_prtt1c_start + get_runtime_offset(); + + stm32mp1_barebox_entry(fdt); +} + +ENTRY_FUNCTION(start_prtt1s, r0, r1, r2) +{ + void *fdt; + + stm32mp_cpu_lowlevel_init(); + + if (IS_ENABLED(CONFIG_DEBUG_LL)) + setup_uart(); + + fdt = __dtb_z_stm32mp151_prtt1s_start + get_runtime_offset(); + + stm32mp1_barebox_entry(fdt); +} diff --git a/arch/arm/boards/qemu-virt/Makefile b/arch/arm/boards/qemu-virt/Makefile index 8451c7832d..dcfc2937d3 100644 --- a/arch/arm/boards/qemu-virt/Makefile +++ b/arch/arm/boards/qemu-virt/Makefile @@ -1,2 +1 @@ obj-y += board.o -obj-y += overlay-of-flash.dtb.o diff --git a/arch/arm/boards/qemu-virt/board.c b/arch/arm/boards/qemu-virt/board.c deleted file mode 100644 index b2a3cb29ab..0000000000 --- a/arch/arm/boards/qemu-virt/board.c +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (C) 2020 Pengutronix e.K. - * - */ -#include <common.h> -#include <init.h> -#include <of.h> -#include <asm/system_info.h> -#include <asm/barebox-arm.h> - -#ifdef CONFIG_64BIT -#define MACHINE "virt64" -#else -#define MACHINE "virt" -#endif - -extern char __dtb_overlay_of_flash_start[]; - -static int replace_dtb(void) { - struct device_node *overlay; - void *fdt; - struct device_node *root; - - fdt = barebox_arm_boot_dtb(); - if (fdt) - pr_debug("using boarddata provided DTB\n"); - - if (!fdt) { - pr_debug("No DTB found\n"); - return 0; - } - - root = of_unflatten_dtb(fdt, INT_MAX); - - if (!of_device_is_compatible(root, "linux,dummy-virt")) { - of_delete_node(root); - return 0; - } - - overlay = of_unflatten_dtb(__dtb_overlay_of_flash_start, INT_MAX); - of_overlay_apply_tree(root, overlay); - - return barebox_register_of(root); -} - -pure_initcall(replace_dtb); - -static int virt_probe(struct device_d *dev) -{ - const char *hostname = MACHINE; - - if (cpu_is_cortex_a7()) - hostname = "virt-a7"; - else if (cpu_is_cortex_a15()) - hostname = "virt-a15"; - - barebox_set_model("ARM QEMU " MACHINE); - barebox_set_hostname(hostname); - - return 0; -} - -static const struct of_device_id virt_of_match[] = { - { .compatible = "linux,dummy-virt" }, - { /* Sentinel */}, -}; - -static struct driver_d virt_board_driver = { - .name = "board-qemu-virt", - .probe = virt_probe, - .of_compatible = virt_of_match, -}; - -postcore_platform_driver(virt_board_driver); diff --git a/arch/arm/boards/qemu-virt/overlay-of-flash.dts b/arch/arm/boards/qemu-virt/overlay-of-flash.dts deleted file mode 100644 index e00dc5d7e2..0000000000 --- a/arch/arm/boards/qemu-virt/overlay-of-flash.dts +++ /dev/null @@ -1,97 +0,0 @@ -/dts-v1/; -/plugin/; -/ { - fragment@0 { - target-path = "/flash@0"; - __overlay__ { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "initramfs"; - reg = <0x0 0x3c00000>; - }; - - environment_flash: partition@3c00000 { - label = "barebox-environment"; - reg = <0x3c00000 0x200000>; - }; - - backend_state_flash: partition@3e00000 { - label = "barebox-state"; - reg = <0x3e00000 0x200000>; - }; - }; - }; - }; - fragment@1 { - target-path="/"; - __overlay__ { - chosen { - environment { - compatible = "barebox,environment"; - device-path = "/flash@0/partitions/partition@3c00000"; - }; - }; - aliases { - state = "/state"; - }; - - state { - #address-cells = <1>; - #size-cells = <1>; - compatible = "barebox,state"; - magic = <0x290cf8c6>; - backend-type = "raw"; - backend = < &backend_state_flash >; - backend-stridesize = <0x200>; - - bootstate { - #address-cells = <1>; - #size-cells = <1>; - - system0 { - #address-cells = <1>; - #size-cells = <1>; - - remaining_attempts@0 { - reg = <0x0 0x4>; - type = "uint32"; - default = <3>; - }; - - priority@4 { - reg = <0x4 0x4>; - type = "uint32"; - default = <20>; - }; - }; - - system1 { - #address-cells = <1>; - #size-cells = <1>; - - remaining_attempts@8 { - reg = <0x8 0x4>; - type = "uint32"; - default = <3>; - }; - - priority@c { - reg = <0xc 0x4>; - type = "uint32"; - default = <21>; - }; - }; - - last_chosen@10 { - reg = <0x10 0x4>; - type = "uint32"; - }; - }; - }; - }; - }; -}; diff --git a/arch/arm/boards/rockchip-rk3568-evb/.gitignore b/arch/arm/boards/rockchip-rk3568-evb/.gitignore new file mode 100644 index 0000000000..f458f794b5 --- /dev/null +++ b/arch/arm/boards/rockchip-rk3568-evb/.gitignore @@ -0,0 +1 @@ +sdram-init.bin diff --git a/arch/arm/configs/imx_v7_defconfig b/arch/arm/configs/imx_v7_defconfig index 624698ae3c..8e707b9602 100644 --- a/arch/arm/configs/imx_v7_defconfig +++ b/arch/arm/configs/imx_v7_defconfig @@ -133,6 +133,9 @@ CONFIG_CMD_WD=y CONFIG_CMD_BAREBOX_UPDATE=y CONFIG_CMD_OF_NODE=y CONFIG_CMD_OF_PROPERTY=y +CONFIG_CMD_OF_DISPLAY_TIMINGS=y +CONFIG_CMD_OF_FIXUP_STATUS=y +CONFIG_CMD_OF_OVERLAY=y CONFIG_CMD_OFTREE=y CONFIG_CMD_TIME=y CONFIG_CMD_STATE=y @@ -195,6 +198,7 @@ CONFIG_WATCHDOG=y CONFIG_WATCHDOG_IMX=y CONFIG_PWM=y CONFIG_PWM_IMX=y +CONFIG_IMX_OCOTP_WRITE=y CONFIG_MXS_APBH_DMA=y CONFIG_GPIO_STMPE=y CONFIG_REGULATOR=y diff --git a/arch/arm/configs/qemu_virt64_defconfig b/arch/arm/configs/qemu_virt64_defconfig index 17509ce9d6..57e715bf8d 100644 --- a/arch/arm/configs/qemu_virt64_defconfig +++ b/arch/arm/configs/qemu_virt64_defconfig @@ -1,25 +1,31 @@ CONFIG_ARCH_ARM64_VIRT=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_ARM_PSCI_CLIENT=y CONFIG_MMU=y # CONFIG_MMU_EARLY is not set +CONFIG_MALLOC_SIZE=0x0 CONFIG_KALLSYMS=y CONFIG_PROMPT="" CONFIG_HUSH_FANCY_PROMPT=y CONFIG_CMDLINE_EDITING=y CONFIG_AUTO_COMPLETE=y CONFIG_MENU=y -CONFIG_IMD=y +CONFIG_BOOTM_INITRD=y +CONFIG_BLSPEC=y CONFIG_CONSOLE_ACTIVATE_NONE=y CONFIG_CONSOLE_ALLOW_COLOR=y CONFIG_PARTITION_DISK_EFI=y CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y -CONFIG_POLLER=y CONFIG_STATE=y CONFIG_BOOTCHOOSER=y CONFIG_RESET_SOURCE=y CONFIG_MACHINE_ID=y CONFIG_LONGHELP=y +CONFIG_CMD_IOMEM=y +CONFIG_CMD_IMD=y CONFIG_CMD_MEMINFO=y +CONFIG_CMD_POLLER=y +CONFIG_CMD_SLICE=y CONFIG_CMD_GO=y CONFIG_CMD_LOADB=y CONFIG_CMD_RESET=y @@ -32,6 +38,7 @@ CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y CONFIG_CMD_SAVEENV=y CONFIG_CMD_FILETYPE=y +CONFIG_CMD_LN=y CONFIG_CMD_SHA256SUM=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_SLEEP=y @@ -41,6 +48,8 @@ CONFIG_CMD_LOGIN=y CONFIG_CMD_MENU=y CONFIG_CMD_MENU_MANAGEMENT=y CONFIG_CMD_PASSWD=y +CONFIG_CMD_SPLASH=y +CONFIG_CMD_FBTEST=y CONFIG_CMD_READLINE=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_CRC=y @@ -48,6 +57,7 @@ CONFIG_CMD_CRC_CMP=y CONFIG_CMD_DETECT=y CONFIG_CMD_FLASH=y CONFIG_CMD_POWEROFF=y +CONFIG_CMD_SMC=y CONFIG_CMD_BAREBOX_UPDATE=y CONFIG_CMD_OF_DIFF=y CONFIG_CMD_OF_NODE=y @@ -56,11 +66,20 @@ CONFIG_CMD_OF_DISPLAY_TIMINGS=y CONFIG_CMD_OF_FIXUP_STATUS=y CONFIG_CMD_OF_OVERLAY=y CONFIG_CMD_OFTREE=y +CONFIG_CMD_TIME=y CONFIG_CMD_STATE=y +CONFIG_NET=y +CONFIG_NET_NFS=y +CONFIG_NET_NETCONSOLE=y +CONFIG_NET_DHCP=y +CONFIG_NET_SNTP=y +CONFIG_NET_FASTBOOT=y CONFIG_OF_BAREBOX_DRIVERS=y CONFIG_OF_BAREBOX_ENV_IN_FS=y +CONFIG_OF_OVERLAY_LIVE=y CONFIG_SERIAL_AMBA_PL011=y CONFIG_VIRTIO_CONSOLE=y +CONFIG_DRIVER_NET_VIRTIO=y # CONFIG_SPI is not set CONFIG_MTD=y CONFIG_DRIVER_CFI=y @@ -68,11 +87,23 @@ CONFIG_CFI_BUFFER_WRITE=y CONFIG_DISK=y CONFIG_DISK_WRITE=y CONFIG_VIRTIO_BLK=y +CONFIG_VIDEO=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_DRIVER_VIDEO_BOCHS_PCI=y +CONFIG_SOUND=y +CONFIG_STATE_DRV=y +CONFIG_VIRTIO_INPUT=y CONFIG_HWRNG=y CONFIG_HW_RANDOM_VIRTIO=y # CONFIG_PINCTRL is not set +CONFIG_NVMEM=y +CONFIG_NVMEM_RMEM=y +CONFIG_PCI_ECAM_GENERIC=y +CONFIG_NVMEM_REBOOT_MODE=y CONFIG_VIRTIO_MMIO=y +CONFIG_VIRTIO_PCI=y CONFIG_FS_EXT4=y +CONFIG_FS_NFS=y CONFIG_FS_FAT=y CONFIG_FS_PSTORE=y CONFIG_FS_PSTORE_CONSOLE=y diff --git a/arch/arm/configs/stm32mp_defconfig b/arch/arm/configs/stm32mp_defconfig index eb3c95b12c..d682083d40 100644 --- a/arch/arm/configs/stm32mp_defconfig +++ b/arch/arm/configs/stm32mp_defconfig @@ -3,6 +3,7 @@ CONFIG_MACH_STM32MP15XX_DKX=y CONFIG_MACH_LXA_MC1=y CONFIG_MACH_SEEED_ODYSSEY=y CONFIG_MACH_STM32MP15X_EV1=y +CONFIG_MACH_PROTONIC_STM32MP1=y CONFIG_THUMB2_BAREBOX=y CONFIG_ARM_BOARD_APPEND_ATAG=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y diff --git a/arch/arm/cpu/board-dt-2nd.c b/arch/arm/cpu/board-dt-2nd.c index 6f6f535918..0731aecd1a 100644 --- a/arch/arm/cpu/board-dt-2nd.c +++ b/arch/arm/cpu/board-dt-2nd.c @@ -12,29 +12,24 @@ #ifdef CONFIG_CPU_V8 -static noinline void dt_2nd_continue_aarch64(void *fdt) -{ - unsigned long membase, memsize; - - if (!fdt) - hang(); - - fdt_find_mem(fdt, &membase, &memsize); - - barebox_arm_entry(membase, memsize, fdt); -} - /* called from assembly */ void dt_2nd_aarch64(void *fdt); void dt_2nd_aarch64(void *fdt) { + unsigned long membase, memsize; + /* entry point already set up stack */ relocate_to_current_adr(); setup_c(); - dt_2nd_continue_aarch64(fdt); + if (!fdt) + hang(); + + fdt_find_mem(fdt, &membase, &memsize); + + barebox_arm_entry(membase, memsize, fdt); } #else diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 7da366bda0..76c96752cd 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -95,6 +95,10 @@ lwl-$(CONFIG_MACH_PROTONIC_IMX6) += \ imx6ul-prti6g.dtb.o \ imx6ull-jozacp.dtb.o lwl-$(CONFIG_MACH_PROTONIC_IMX8M) += imx8mm-prt8mm.dtb.o +lwl-$(CONFIG_MACH_PROTONIC_STM32MP1) += \ + stm32mp151-prtt1a.dtb.o \ + stm32mp151-prtt1c.dtb.o \ + stm32mp151-prtt1s.dtb.o lwl-$(CONFIG_MACH_RADXA_ROCK) += rk3188-radxarock.dtb.o lwl-$(CONFIG_MACH_PHYTEC_SOM_RK3288) += rk3288-phycore-som.dtb.o lwl-$(CONFIG_MACH_REALQ7) += imx6q-dmo-edmqmx6.dtb.o diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi index 0653fcc3c3..ada1607688 100644 --- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi +++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi @@ -81,15 +81,6 @@ }; }; -&fec { - /* - * barebox doesn't have a driver for the PMIC providing the phy-supply - * (dlg,da9063). So remove the phy-supply property and rely on the - * PMIC's reset default which has this supply enabled. - */ - /delete-property/ phy-supply; -}; - &gpmi { partitions { compatible = "fixed-partitions"; @@ -162,5 +153,8 @@ watchdog-priority = <500>; restart-priority = <500>; reset-source-priority = <500>; + regulators { + barebox,allow-dummy-supply; + }; }; }; diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi index 7789c9d3b5..56dbf0b97d 100644 --- a/arch/arm/dts/socfpga.dtsi +++ b/arch/arm/dts/socfpga.dtsi @@ -4,6 +4,10 @@ }; }; +&mmc { + reset-names = "reset"; +}; + &watchdog0 { resets = <&rst L4WD0_RESET>; }; diff --git a/arch/arm/dts/stm32mp151-prtt1a.dts b/arch/arm/dts/stm32mp151-prtt1a.dts new file mode 100644 index 0000000000..0f3c50f3e9 --- /dev/null +++ b/arch/arm/dts/stm32mp151-prtt1a.dts @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) +// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland +// SPDX-FileCopyrightText: 2021 Oleksij Rempel, Pengutronix +/dts-v1/; + +#include "stm32mp151-prtt1l.dtsi" +#include "stm32mp151-prtt1l-net.dtsi" + +/ { + model = "Protonic PRTT1A"; + compatible = "prt,prtt1a", "st,stm32mp151"; + + chosen { + environment-sd { + compatible = "barebox,environment"; + device-path = &sdmmc1, "partname:barebox-environment"; + status = "disabled"; + }; + }; +}; diff --git a/arch/arm/dts/stm32mp151-prtt1c.dts b/arch/arm/dts/stm32mp151-prtt1c.dts new file mode 100644 index 0000000000..fc411f9719 --- /dev/null +++ b/arch/arm/dts/stm32mp151-prtt1c.dts @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) +// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland +// SPDX-FileCopyrightText: 2021 Oleksij Rempel, Pengutronix +/dts-v1/; + +#include "stm32mp151-prtt1l.dtsi" + +/ { + model = "Protonic PRTT1C"; + compatible = "prt,prtt1c", "st,stm32mp151"; + + chosen { + environment-sd { + compatible = "barebox,environment"; + device-path = &sdmmc1, "partname:barebox-environment"; + status = "disabled"; + }; + + environment-emmc { + compatible = "barebox,environment"; + device-path = &sdmmc2, "partname:barebox-environment"; + status = "disabled"; + }; + }; +}; + +ðernet0 { + pinctrl-0 = <ðernet0_rmii_pins_a>; + pinctrl-names = "default"; + phy-mode = "rmii"; + phy-reset-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>; + status = "okay"; + + fixed-link { + speed = <100>; + full-duplex; + }; +}; + +&sdmmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>; + disable-wp; + disable-cd; + no-removable; + no-sd; + no-sdio; + no-1-8-v; + st,neg-edge; + bus-width = <8>; + vmmc-supply = <&v3v3>; + vqmmc-supply = <&v3v3>; + status = "okay"; +}; + +ðernet0_rmii_pins_a { + pins1 { + pinmux = <STM32_PINMUX('B', 12, AF11)>, /* ETH1_RMII_TXD0 */ + <STM32_PINMUX('B', 13, AF11)>, /* ETH1_RMII_TXD1 */ + <STM32_PINMUX('B', 11, AF11)>, /* ETH1_RMII_TX_EN */ + <STM32_PINMUX('A', 2, AF11)>, /* ETH1_MDIO */ + <STM32_PINMUX('C', 1, AF11)>; /* ETH1_MDC */ + }; + pins2 { + pinmux = <STM32_PINMUX('C', 4, AF11)>, /* ETH1_RMII_RXD0 */ + <STM32_PINMUX('C', 5, AF11)>, /* ETH1_RMII_RXD1 */ + <STM32_PINMUX('A', 1, AF11)>, /* ETH1_RMII_REF_CLK input */ + <STM32_PINMUX('A', 7, AF11)>; /* ETH1_RMII_CRS_DV */ + }; +}; + +&sdmmc2_b4_pins_a { + pins1 { + pinmux = <STM32_PINMUX('B', 14, AF9)>, /* SDMMC2_D0 */ + <STM32_PINMUX('B', 7, AF10)>, /* SDMMC2_D1 */ + <STM32_PINMUX('B', 3, AF9)>, /* SDMMC2_D2 */ + <STM32_PINMUX('B', 4, AF9)>, /* SDMMC2_D3 */ + <STM32_PINMUX('G', 6, AF10)>; /* SDMMC2_CMD */ + }; +}; + +&sdmmc2_d47_pins_a { + pins { + pinmux = <STM32_PINMUX('A', 8, AF9)>, /* SDMMC2_D4 */ + <STM32_PINMUX('A', 9, AF10)>, /* SDMMC2_D5 */ + <STM32_PINMUX('C', 6, AF10)>, /* SDMMC2_D6 */ + <STM32_PINMUX('C', 7, AF10)>; /* SDMMC2_D7 */ + }; +}; diff --git a/arch/arm/dts/stm32mp151-prtt1l-net.dtsi b/arch/arm/dts/stm32mp151-prtt1l-net.dtsi new file mode 100644 index 0000000000..04f4d64aaa --- /dev/null +++ b/arch/arm/dts/stm32mp151-prtt1l-net.dtsi @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) +// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland +// SPDX-FileCopyrightText: 2021 Oleksij Rempel, Pengutronix + +ðernet0 { + pinctrl-0 = <ðernet0_rmii_pins_a>; + pinctrl-names = "default"; + phy-mode = "rmii"; + phy-reset-gpios = <&gpioa 3 GPIO_ACTIVE_LOW>; + status = "okay"; + + mdio0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + phy0: ethernet-phy@0 { + reg = <0>; + }; + }; +}; + +ðernet0_rmii_pins_a { + pins1 { + pinmux = <STM32_PINMUX('B', 12, AF11)>, /* ETH1_RMII_TXD0 */ + <STM32_PINMUX('B', 13, AF11)>, /* ETH1_RMII_TXD1 */ + <STM32_PINMUX('B', 11, AF11)>, /* ETH1_RMII_TX_EN */ + <STM32_PINMUX('A', 2, AF11)>, /* ETH1_MDIO */ + <STM32_PINMUX('C', 1, AF11)>; /* ETH1_MDC */ + }; + pins2 { + pinmux = <STM32_PINMUX('C', 4, AF11)>, /* ETH1_RMII_RXD0 */ + <STM32_PINMUX('C', 5, AF11)>, /* ETH1_RMII_RXD1 */ + <STM32_PINMUX('A', 1, AF11)>, /* ETH1_RMII_REF_CLK input */ + <STM32_PINMUX('A', 7, AF11)>; /* ETH1_RMII_CRS_DV */ + }; +}; diff --git a/arch/arm/dts/stm32mp151-prtt1l.dtsi b/arch/arm/dts/stm32mp151-prtt1l.dtsi new file mode 100644 index 0000000000..80ae72dee2 --- /dev/null +++ b/arch/arm/dts/stm32mp151-prtt1l.dtsi @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) +// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland +// SPDX-FileCopyrightText: 2021 Oleksij Rempel, Pengutronix + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <arm/stm32mp151.dtsi> +#include <arm/stm32mp15-pinctrl.dtsi> +#include <arm/stm32mp15xxad-pinctrl.dtsi> + +#include "stm32mp151.dtsi" + +/ { + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + serial0 = &uart4; + ethernet0 = ðernet0; + }; + + v3v3: fixed-regulator-v3v3 { + compatible = "regulator-fixed"; + regulator-name = "v3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + led { + compatible = "gpio-leds"; + + led-0 { + label = "debug:red"; + gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; + }; + + led-1 { + label = "debug:green"; + gpios = <&gpioa 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + }; + }; +}; + +&usbh_ehci { + phys = <&usbphyc_port0>; + phy-names = "usb"; + status = "okay"; +}; + +&usbotg_hs { + dr_mode = "host"; + pinctrl-0 = <&usbotg_hs_pins_a>; + pinctrl-names = "default"; + phys = <&usbphyc_port1 0>; + phy-names = "usb2-phy"; + status = "okay"; +}; + +&usbphyc { + status = "okay"; +}; + +&usbphyc_port1 { + phy-supply = <&v3v3>; +}; + +&sdmmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc1_b4_pins_a>; + st,neg-edge; + bus-width = <4>; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-ddr50; + vmmc-supply = <&v3v3>; + vqmmc-supply = <&v3v3>; + status = "okay"; +}; + +&sdmmc1_b4_pins_a { + pins1 { + bias-pull-up; + }; + pins2 { + bias-pull-up; + }; +}; + +&uart4 { + pinctrl-names = "default"; + pinctrl-0 = <&uart4_pins_a>; + status = "okay"; +}; + +&uart4_pins_a { + pins1 { + pinmux = <STM32_PINMUX('B', 9, AF8)>; /* UART4_TX */ + bias-disable; + drive-push-pull; + slew-rate = <0>; + }; + pins2 { + pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */ + bias-pull-up; + }; +}; diff --git a/arch/arm/dts/stm32mp151-prtt1s.dts b/arch/arm/dts/stm32mp151-prtt1s.dts new file mode 100644 index 0000000000..f9093d01ac --- /dev/null +++ b/arch/arm/dts/stm32mp151-prtt1s.dts @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause) +// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland +// SPDX-FileCopyrightText: 2021 Oleksij Rempel, Pengutronix +/dts-v1/; + +#include "stm32mp151-prtt1l.dtsi" +#include "stm32mp151-prtt1l-net.dtsi" + +/ { + model = "Protonic PRTT1S"; + compatible = "prt,prtt1s", "st,stm32mp151"; + + chosen { + environment-sd { + compatible = "barebox,environment"; + device-path = &sdmmc1, "partname:barebox-environment"; + status = "disabled"; + }; + }; +}; diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h index bf3a1a0ed2..9ebe80dc89 100644 --- a/arch/arm/include/asm/cache.h +++ b/arch/arm/include/asm/cache.h @@ -21,6 +21,9 @@ int arm_set_cache_functions(void); void arm_early_mmu_cache_flush(void); void arm_early_mmu_cache_invalidate(void); +#define sync_caches_for_execution sync_caches_for_execution void sync_caches_for_execution(void); +#include <asm-generic/cache.h> + #endif diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig index 95d3dc510d..8328eb899a 100644 --- a/arch/arm/mach-stm32mp/Kconfig +++ b/arch/arm/mach-stm32mp/Kconfig @@ -31,4 +31,11 @@ config MACH_STM32MP15X_EV1 as SSBL on any STM32MP15X-EVAL platform, like the STM32MP157C-EV1 +config MACH_PROTONIC_STM32MP1 + select ARCH_STM32MP157 + bool "Protonic PRTT1L family of boards" + help + Builds all barebox-prtt1*.img that can be deployed as SSBL + on the respective PRTT1L family board + endif |