Next step to enable DT support for at91sam9263ek?
Subsystems (4)
Hi all.
I have now spent some time trying to dive into how to enable DT support for at91sam9263ek - but so far with only limited success. I have copied the device tree from the kernel and included the tree in the build. This step was simple.
I also updated the ENTRY_FUNCTION to take a pointer to the ftd. Also simple.
There was a few build issues that I then had to fix. But when running the resulting barebox nothing was printed to the console.
I ended up dropping following from the build:arch/arm/boards/at91sam9263ek/init.c arch/arm/mach-at91/at91sam9263.c arch/arm/mach-at91/at91sam9263_devices.c
Thein I got following output when booting:
barebox 2017.07.0-00082-g265d9e416-dirty #27 Sat Jul 8 00:00:54 CEST 2017
Board: Atmel at91sam9263ek
fset: 10000000
Main crystal frequency not set, using approximate value
AT91: Detected soc type: at91sam9263
AT91: Detected soc subtype: Unknown
comparing usart with usart
Main crystal frequency not set, using approximate value comparing usart with usart
Main crystal frequency not set, using approximate value gpio-at91 fffff200.gpio: AT91 gpio driver registered gpio-at91 fffff400.gpio: AT91 gpio driver registered gpio-at91 fffff600.gpio: AT91 gpio driver registered gpio-at91 fffff800.gpio: AT91 gpio driver registered gpio-at91 fffffa00.gpio: AT91 gpio driver registered pinctrl-at91 pinctrl.2: AT91 pinctrl registered comparing macb_clk with hclk
comparing macb_clk with pclk
macb fffbc000.ethernet: no macb_clk
macb fffbc000.ethernet: probe failed: Invalid argumentof_get_named_gpio_flags: cannot parse cd-gpios property: -2 comparing mci_clk with mci_clk
Main crystal frequency not set, using approximate value atmel_mci fff80000.mmc: version: 0x210atmel_mci fff80000.mmc: registered as fff80000.mmc malloc space: 0x23afad80 -> 0x23efad7f (size 4 MiB) environment load /dev/env0: No such file or directory Maybe you have to create the partition.
running /env/bin/init...
\e[?25h
Hit any key to stop autoboot: 1
This does not look entirely correct...
Right now I am a bit stuck for what would be next step - any hints would be highly appreciated.
Sam
The current patch looks like this (with some hacks included):
arch/arm/boards/at91sam9263ek/lowlevel_init.c +8 -3
@@ -99,7 +99,7 @@ static void __bare_init at91sam9263ek_board_config(struct at91sam926x_board_cfgAT91_RSTC_RSTTYP_WATCHDOG ; } -static void __bare_init at91sam9263ek_init(void) +static void __bare_init at91sam9263ek_init(void *fdt) {struct at91sam926x_board_cfg cfg;
@@ -112,14 +112,19 @@ static void __bare_init at91sam9263ek_init(void)at91sam926x_board_init (&cfg);barebox_arm_entry (AT91_CHIPSELECT_1 ,at91_get_sdram_size (cfg.sdramc), -NULL ); + fdt); } +extern char __dtb_at91sam9263ek_start[]; + ENTRY_FUNCTION(start_at91sam9263ek, r0, r1, r2) { +void *fdt; +arm_cpu_lowlevel_init ();arm_setup_stack (AT91SAM9263_SRAM0_BASE +AT91SAM9263_SRAM0_SIZE -16 ); + fdt = __dtb_at91sam9263ek_start -get_runtime_offset (); -at91sam9263ek_init (); +at91sam9263ek_init (fdt); }
arch/arm/configs/at91sam9263ek_defconfig +2 -0
@@ -37,6 +37,7 @@ CONFIG_CMD_EDIT=y CONFIG_CMD_SPLASH=y CONFIG_CMD_READLINE=y CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_CLK=y CONFIG_CMD_FLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_LED=y
@@ -44,6 +45,7 @@ CONFIG_CMD_LED_TRIGGER=y CONFIG_CMD_OFTREE=y CONFIG_NET=y CONFIG_NET_NFS=y +CONFIG_OF_BAREBOX_DRIVERS=y CONFIG_DRIVER_NET_MACB=y # CONFIG_SPI is not set CONFIG_MTD=y
arch/arm/dts/Makefile +1 -1
@@ -97,7 +97,7 @@ pbl-dtb-$(CONFIG_MACH_ZII_VF610_DEV) += \ vf610-zii-cfu1-rev-a.dtb.o \ vf610-zii-spu3-rev-a.dtb.o \ vf610-zii-scu4-aib-rev-c.dtb.o - +pbl-dtb-$(CONFIG_MACH_AT91SAM9263EK) += at91sam9263ek.dtb.o pbl-dtb-$(CONFIG_MACH_AT91SAM9X5EK) += at91sam9x5ek.dtb.o
arch/arm/dts/at91sam9263.dtsi new file +1081 -0
1,081 lines not on this page · raw message
arch/arm/dts/at91sam9263ek.dts new file +246 -0
246 lines not on this page · raw message
arch/arm/mach-at91/Kconfig +3 -0
@@ -522,6 +522,9 @@ if AT91_MULTI_BOARDS config MACH_AT91SAM9263EK bool "Atmel AT91SAM9263-EK" depends on ARCH_AT91SAM9263 + select OFDEVICE + select COMMON_CLK_OF_PROVIDER + select HAVE_AT91_USB_CLK select HAVE_NAND_ATMEL_BUSWIDTH_16 select HAVE_AT91_BOOTSTRAP help
arch/arm/boards/at91sam9263ek/Makefile +1 -1
@@ -1,4 +1,4 @@ -obj-y += init.o +obj-n += init.o lwl-y += lowlevel_init.o bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-at91sam9263ek
arch/arm/mach-at91/Makefile +3 -1
@@ -1,3 +1,5 @@ +EXTRA_CFLAGS := -DVERBOSE_DEBUG + obj-y += setup.o irq_fixup.o ifeq ($(CONFIG_COMMON_CLK_OF_PROVIDER),)
@@ -17,7 +19,7 @@ obj-$(CONFIG_AT91SAM9_SMC) += sam9_smc.o obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam9260_devices.o obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam9261_devices.o -obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam9263_devices.o +obj-$(CONFIG_ARCH_AT91SAM9263)x += at91sam9263.o at91sam9263_devices.o obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261.o at91sam9261_devices.o obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam9260_devices.o obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam9g45_devices.o
arch/arm/mach-at91/setup.c +1 -1
@@ -63,7 +63,7 @@ static void __init soc_detect(u32 dbgu_base)case ARCH_ID_AT91SAM9263 : at91_soc_initdata.type =AT91_SOC_SAM9263 ; - at91_boot_soc = at91sam9263_soc; +//at91_boot_soc = at91sam9263_soc; break ;case ARCH_ID_AT91SAM9G20 :
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Hi Sam,
Am Samstag, den 08.07.2017, 00:17 +0200 schrieb Sam Ravnborg:
Quoted 54 lines
Hi all.
I have now spent some time trying to dive into how to enable DT support for at91sam9263ek - but so far with only limited success. I have copied the device tree from the kernel and included the tree in the build. This step was simple.
I also updated the
ENTRY_FUNCTIONto take a pointer to the ftd. Also simple.There was a few build issues that I then had to fix. But when running the resulting barebox nothing was printed to the console.
I ended up dropping following from the build:arch/arm/boards/at91sam9263ek/init.carch/arm/mach-at91/at91sam9263.carch/arm/mach-at91/at91sam9263_devices.cThein I got following output when booting:
barebox 2017.07.0-00082-g265d9e416-dirty #27 Sat Jul 8 00:00:54 CEST 2017
Board: Atmel at91sam9263ek
fset: 10000000
Main crystal frequency not set, using approximate value
AT91: Detected soc type: at91sam9263
AT91: Detected soc subtype: Unknown
comparing usart with usart
Main crystal frequency not set, using approximate value comparing usart with usart
Main crystal frequency not set, using approximate value gpio-at91 fffff200.gpio: AT91 gpio driver registered gpio-at91 fffff400.gpio: AT91 gpio driver registered gpio-at91 fffff600.gpio: AT91 gpio driver registered gpio-at91 fffff800.gpio: AT91 gpio driver registered gpio-at91 fffffa00.gpio: AT91 gpio driver registered pinctrl-at91 pinctrl.2: AT91 pinctrl registered comparingmacb_clkwith hclk
comparingmacb_clkwith pclk
macb fffbc000.ethernet: nomacb_clk
macb fffbc000.ethernet: probe failed: Invalid argumentof_get_named_gpio_flags: cannot parse cd-gpios property: -2 comparingmci_clkwithmci_clk
Main crystal frequency not set, using approximate valueatmel_mcifff80000.mmc: version:0x210atmel_mcifff80000.mmc: registered as fff80000.mmc malloc space:0x23afad80->0x23efad7f(size 4 MiB) environment load/dev/env0: No such file or directory Maybe you have to create the partition.
running /env/bin/init...
\e[?25h
Hit any key to stop autoboot: 1
Quoted 4 lines
This does not look entirely correct...
Right now I am a bit stuck for what would be next step - any hints would be highly appreciated.
Probably a lot of the devices present on the AT91 boards have driver with no proper DT support in Barebox, so you might need to extend some of them.
Also if the boards have any specific board code, you need to convert that to initcalls guarded by the board DT compatible.
HTH,
Lucas
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox