diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-08-19 07:37:05 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-08-19 07:37:05 +0200 |
commit | 4a16b52ebacf1874bfe2035077c2ba17633f7490 (patch) | |
tree | 2850b2e32677b95bc014d552eefd5c94bf4e2973 /arch/arm/boards | |
parent | db6394231e8f10d0d7677e3a239dc700ad4a8036 (diff) | |
parent | ac5faaaa0d3bcc9c089fddb210d6049f75b8adad (diff) | |
download | barebox-4a16b52ebacf1874bfe2035077c2ba17633f7490.tar.gz barebox-4a16b52ebacf1874bfe2035077c2ba17633f7490.tar.xz |
Merge branch 'for-next/stm32' into master
Diffstat (limited to 'arch/arm/boards')
-rw-r--r-- | arch/arm/boards/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/boards/seeed-odyssey/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/boards/seeed-odyssey/board.c | 32 | ||||
-rw-r--r-- | arch/arm/boards/seeed-odyssey/lowlevel.c | 19 |
4 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile index 5e6c0243d8..986ea7a983 100644 --- a/arch/arm/boards/Makefile +++ b/arch/arm/boards/Makefile @@ -124,6 +124,7 @@ obj-$(CONFIG_MACH_MICROCHIP_KSZ9477_EVB) += microchip-ksz9477-evb/ obj-$(CONFIG_MACH_SAMA5D4_XPLAINED) += sama5d4_xplained/ obj-$(CONFIG_MACH_SAMA5D4EK) += sama5d4ek/ obj-$(CONFIG_MACH_SCB9328) += scb9328/ +obj-$(CONFIG_MACH_SEEED_ODYSSEY) += seeed-odyssey/ obj-$(CONFIG_MACH_SOCFPGA_ALTERA_SOCDK) += altera-socdk/ obj-$(CONFIG_MACH_SOCFPGA_EBV_SOCRATES) += ebv-socrates/ obj-$(CONFIG_MACH_SOCFPGA_REFLEX_ACHILLES) += reflex-achilles/ diff --git a/arch/arm/boards/seeed-odyssey/Makefile b/arch/arm/boards/seeed-odyssey/Makefile new file mode 100644 index 0000000000..092c31d6b2 --- /dev/null +++ b/arch/arm/boards/seeed-odyssey/Makefile @@ -0,0 +1,2 @@ +lwl-y += lowlevel.o +obj-y += board.o diff --git a/arch/arm/boards/seeed-odyssey/board.c b/arch/arm/boards/seeed-odyssey/board.c new file mode 100644 index 0000000000..e3fe536873 --- /dev/null +++ b/arch/arm/boards/seeed-odyssey/board.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0+ +#include <common.h> +#include <linux/sizes.h> +#include <init.h> +#include <asm/memory.h> +#include <mach/bbu.h> +#include <bootsource.h> +#include <of.h> + +static int odyssey_device_init(void) +{ + int flags; + int instance = bootsource_get_instance(); + + if (!of_machine_is_compatible("seeed,stm32mp157c-odyssey-som")) + return 0; + + flags = instance == 0 ? BBU_HANDLER_FLAG_DEFAULT : 0; + stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", flags); + + flags = instance == 1 ? BBU_HANDLER_FLAG_DEFAULT : 0; + stm32mp_bbu_mmc_register_handler("emmc", "/dev/mmc1.ssbl", flags); + + + if (instance == 0) + of_device_enable_path("/chosen/environment-sd"); + else + of_device_enable_path("/chosen/environment-emmc"); + + return 0; +} +device_initcall(odyssey_device_init); diff --git a/arch/arm/boards/seeed-odyssey/lowlevel.c b/arch/arm/boards/seeed-odyssey/lowlevel.c new file mode 100644 index 0000000000..5ab1639dfe --- /dev/null +++ b/arch/arm/boards/seeed-odyssey/lowlevel.c @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ +#include <common.h> +#include <mach/entry.h> +#include <debug_ll.h> + +extern char __dtb_z_stm32mp157c_odyssey_start[]; + +ENTRY_FUNCTION(start_stm32mp157c_seeed_odyssey, r0, r1, r2) +{ + void *fdt; + + stm32mp_cpu_lowlevel_init(); + + putc_ll('>'); + + fdt = __dtb_z_stm32mp157c_odyssey_start + get_runtime_offset(); + + stm32mp1_barebox_entry(fdt); +} |