diff options
author | Ahmad Fatoum <ahmad@a3f.at> | 2020-07-31 06:59:05 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-08-03 21:15:26 +0200 |
commit | ac5faaaa0d3bcc9c089fddb210d6049f75b8adad (patch) | |
tree | 18f471c7bcd4e17f392e14f18a86fc136411ba97 /arch/arm/boards | |
parent | f91f7747879ec28606293426720c136ec15b0e2d (diff) | |
download | barebox-ac5faaaa0d3bcc9c089fddb210d6049f75b8adad.tar.gz barebox-ac5faaaa0d3bcc9c089fddb210d6049f75b8adad.tar.xz |
ARM: stm32mp: add support for Seeed Odyssey board
Board consists of SoM with stm32mp157c with 4G eMMC and 512M DDR3 RAM.
Carrier board features USB and ETH interfaces and SD card connector.
USB and ETH interfaces not yet operational.
Boot from eMMC requires boot ack bit set.
Device Tree taken from v5 of kernel device tree off mailing list[1].
[1]: https://lore.kernel.org/linux-arm-kernel/20200724145107.35772-3-marcin.sloniewski@gmail.com/
Tested-by: Jookia <contact@jookia.org>
Tested-by: Xogium <contact@xogium.me>
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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 304ae59851..729faddec9 100644 --- a/arch/arm/boards/Makefile +++ b/arch/arm/boards/Makefile @@ -123,6 +123,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); +} |