db410c: configs: increase gunzip buffer size for the kernel
Subsystems (3)
PATCH 1/7 db410c: configs: increase gunzip buffer size for the kernel
From: Jorge Ramirez-Ortiz <[email protected]>
the kernel fails to boot when it goes over the limit.
--- include/configs/dragonboard410c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/dragonboard410c.h +1 -1
@@ -23,7 +23,7 @@#define CONFIG_SYS_TEXT_BASE 0x80080000#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x7fff0)#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x80000) -#define CONFIG_SYS_BOOTM_LEN 0x1000000/* 16MB max kernel size */ +#define CONFIG_SYS_BOOTM_LEN SZ_64M/* UART */
Signature · 1 line
2.7.4
PATCH 2/7 db410c: update wlan and bt mac addresses from firmware
From: Jorge Ramirez-Ortiz <[email protected]>
The firmware that runs before u-boot modifies u-boot's device tree adding the local-mac-address and local-bd-address properties for the compatibles "qcom,wcnss-bt" and "qcom,wcnss-wlan".
This commit reads that firmware, retrieves the properties and fixups the device tree that is passed to the kernel before booting.
--- arch/arm/dts/dragonboard410c.dts | 10 +++++ board/qualcomm/dragonboard410c/Makefile | 1 + board/qualcomm/dragonboard410c/dragonboard410c.c | 49 +++++++++++++++++++++--- board/qualcomm/dragonboard410c/lowlevel_init.S | 28 ++++++++++++++ configs/dragonboard410c_defconfig | 3 ++ 5 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 board/qualcomm/dragonboard410c/lowlevel_init.S
arch/arm/dts/dragonboard410c.dts +10 -0
@@ -86,6 +86,16 @@ clock-frequency = <200000000>; }; + wcnss { + bt { + compatible="qcom,wcnss-bt"; + }; + + wifi { + compatible="qcom,wcnss-wlan"; + }; + }; + spmi at 200f000 { compatible = "qcom,spmi-pmic-arb"; reg = <0x200f800 0x200 0x2400000 0x400000 0x2c00000 0x400000>;
board/qualcomm/dragonboard410c/Makefile +1 -0
@@ -5,4 +5,5 @@ # obj-y := dragonboard410c.o +obj-y += lowlevel_init.o extra-y += head.o
board/qualcomm/dragonboard410c/dragonboard410c.c +43 -6
73 lines not on this page · raw message
board/qualcomm/dragonboard410c/lowlevel_init.S new file +28 -0
@@ -0,0 +1,28 @@ +/* + * (C) Copyright 2016 + * Cédric Schieli <[email protected]> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <config.h> + +.align 8 +.global fw_dtb +fw_dtb: + .dword 0x0 + +/* + * Routine: save_boot_params (called after reset from start.S) + * Description: save ATAG/FDT address provided by the firmware at boot time + */ + +.global save_boot_params +save_boot_params: + + /* The firmware provided ATAG/FDT address can be found in r2/x0 */ + adr x8, fw_dtb + str x0, [x8] + + /* Returns */ + b save_boot_params_ret
configs/dragonboard410c_defconfig +3 -0
@@ -44,3 +44,6 @@ CONFIG_USB_ETHER_ASIX88179=y CONFIG_USB_ETHER_MCS7830=y CONFIG_USB_ETHER_SMSC95XX=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_OF_CONTROL=y +CONFIG_ENV_IS_IN_MMC=y +CONFIG_OF_BOARD_SETUP=y
Signature · 1 line
2.7.4
PATCH 3/7 db410c: replace reset driver with psci
In reply to Jorge Ramirez-OrtizFrom: Jorge Ramirez-Ortiz <[email protected]>
this should be the norm for armv8 platforms.
--- arch/arm/dts/dragonboard410c.dts | 5 --- board/qualcomm/dragonboard410c/dragonboard410c.c | 5 +++ configs/dragonboard410c_defconfig | 2 +- drivers/sysreset/Makefile | 2 -- drivers/sysreset/sysreset_snapdragon.c | 40 ------------------------ 5 files changed, 6 insertions(+), 48 deletions(-) delete mode 100644 drivers/sysreset/sysreset_snapdragon.c
arch/arm/dts/dragonboard410c.dts +0 -5
@@ -48,11 +48,6 @@ clock = <&clkc 4>; }; - restart at 4ab000 { - compatible = "qcom,pshold"; - reg = <0x4ab000 0x4>; - }; - soc_gpios: pinctrl at 1000000 { compatible = "qcom,apq8016-pinctrl"; reg = <0x1000000 0x300000>;
board/qualcomm/dragonboard410c/dragonboard410c.c +5 -0
@@ -171,3 +171,8 @@ int ft_board_setup(void *blob, bd_t *bd)return 0 ; } + +void reset_cpu (ulong addr) +{ +psci_system_reset (); +}
configs/dragonboard410c_defconfig +1 -1
@@ -30,7 +30,6 @@ CONFIG_DM_PMIC=y CONFIG_PMIC_PM8916=y CONFIG_MSM_SERIAL=y CONFIG_SPMI_MSM=y -CONFIG_SYSRESET=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_EHCI_HCD=y
@@ -47,3 +46,4 @@ CONFIG_OF_LIBFDT_OVERLAY=y CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_MMC=y CONFIG_OF_BOARD_SETUP=y +CONFIG_PSCI_RESET=y
drivers/sysreset/Makefile +0 -2
@@ -8,10 +8,8 @@ obj-$(CONFIG_SYSRESET) += sysreset-uclass.o obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o - obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o -obj-$(CONFIG_ARCH_SNAPDRAGON) += sysreset_snapdragon.o obj-$(CONFIG_ARCH_STI) += sysreset_sti.o obj-$(CONFIG_TARGET_XTFPGA) += sysreset_xtfpga.o obj-$(CONFIG_ARCH_ASPEED) += sysreset_ast.o
drivers/sysreset/sysreset_snapdragon.c deleted +0 -40
@@ -1,40 +0,0 @@ -/* -* Qualcomm APQ8016 reset controller driver -* -* (C) Copyright 2015 Mateusz Kulikowski <[email protected]> -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> -#include <dm.h> -#include <errno.h> -#include <sysreset.h> -#include <asm/io.h> - -DECLARE_GLOBAL_DATA_PTR ; - -static int msm_sysreset_request (struct udevice *dev,enum sysreset_t type) -{ -phys_addr_t addr =devfdt_get_addr (dev); -if (!addr) -return -EINVAL ; -writel (0 , addr); -return -EINPROGRESS ; -} - -static struct sysreset_ops msm_sysreset_ops = { - .request = msm_sysreset_request, -}; - -static const struct udevice_id msm_sysreset_ids[] = { - { .compatible ="qcom,pshold" }, - { } -}; - -U_BOOT_DRIVER (msm_reset) = { - .name ="msm_sysreset" , - .id =UCLASS_SYSRESET , - .of_match = msm_sysreset_ids, - .ops = &msm_sysreset_ops, -};
Signature · 1 line
2.7.4
PATCH 4/7 fdtdec: allow board to provide fdt for CONFIG_OF_SEPARATE
In reply to Jorge Ramirez-OrtizFrom: Rob Clark <[email protected]>
Similar to CONFIG_OF_BOARD, but in this case the fdt is still built by u-boot build. This allows the board to patch the fdt, etc.
In the specific case of dragonboard 410c, we pass the u-boot generated fdt to the previous stage of bootloader (by embedding it in the u-boot.img that is loaded by lk/aboot), which patches the fdt and passes it back to u-boot.
--- include/fdtdec.h | 3 ++- lib/fdtdec.c | 35 +++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 13 deletions(-)
include/fdtdec.h +2 -1
@@ -990,7 +990,8 @@ int fdtdec_setup(void);/** * Board-specific FDT initialization. Returns the address to a device tree blob. -* Called when CONFIG_OF_BOARD is defined. +* Called when CONFIG_OF_BOARD is defined, or if CONFIG_OF_SEPARATE is defined +* and the board implements it. */ void *board_fdt_blob_setup (void );
lib/fdtdec.c +23 -12
@@ -1272,6 +1272,28 @@ static int uncompress_blob(const void *src, ulong sz_src, void **dstp)# endif #endif +#if CONFIG_IS_ENABLED (OF_SEPARATE ) +/* +* For CONFIG_OF_SEPARATE, the board may optionally implement this to +* provide and/or fixup the fdt. +*/ +__weak void *board_fdt_blob_setup (void ) +{ +void *fdt_blob =NULL ; +#ifdef CONFIG_SPL_BUILD +/* FDT is at end of BSS unless it is in a different memory region */ +if (IS_ENABLED (CONFIG_SPL_SEPARATE_BSS )) + fdt_blob = (ulong *)&_image_binary_end; +else + fdt_blob = (ulong *)&__bss_end; +#else +/* FDT is at end of image */ + fdt_blob = (ulong *)&_end; +#endif +return fdt_blob; +} +#endif +int fdtdec_setup (void ) {#if CONFIG_IS_ENABLED (OF_CONTROL )
@@ -1285,18 +1307,7 @@ int fdtdec_setup(void)# else gd->fdt_blob = __dtb_dt_begin;# endif -# elif defined CONFIG_OF_SEPARATE -# ifdef CONFIG_SPL_BUILD -/* FDT is at end of BSS unless it is in a different memory region */ -if (IS_ENABLED (CONFIG_SPL_SEPARATE_BSS )) - gd->fdt_blob = (ulong *)&_image_binary_end; -else - gd->fdt_blob = (ulong *)&__bss_end; -# else -/* FDT is at end of image */ - gd->fdt_blob = (ulong *)&_end; -# endif -# elif defined(CONFIG_OF_BOARD) +# elif defined(CONFIG_OF_BOARD) || defined (CONFIG_OF_SEPARATE)/* Allow the board to override the fdt address. */ gd->fdt_blob =board_fdt_blob_setup ();# elif defined(CONFIG_OF_HOSTFILE)
Signature · 1 line
2.7.4
PATCH 5/7 db410c: use the device tree parsed by the lk loader.
In reply to Jorge Ramirez-OrtizFrom: Jorge Ramirez-Ortiz <[email protected]>
We dont need to keep copies of the properties that we are going to fixup since we will be using the dtb provided by the firmware.
--- board/qualcomm/dragonboard410c/dragonboard410c.c | 71 ++++++++++++++---------- configs/dragonboard410c_defconfig | 1 + 2 files changed, 44 insertions(+), 28 deletions(-)
board/qualcomm/dragonboard410c/dragonboard410c.c +43 -28
@@ -15,14 +15,22 @@DECLARE_GLOBAL_DATA_PTR ;/* pointer to the device tree ammended by the firmware */ -extern const void *fw_dtb; +extern void *fw_dtb; -static char wlan_mac[ARP_HLEN ]; -static char bt_mac[ARP_HLEN ]; +void *board_fdt_blob_setup (void ) +{ +if (fdt_magic (fw_dtb) !=FDT_MAGIC ) { +printf ("Firmware provided invalid dtb!\n" ); +return NULL ; + } + +return fw_dtb; +}int dram_init (void ) { gd->ram_size =PHYS_SDRAM_1_SIZE ; +return 0 ; }
@@ -138,36 +146,43 @@ int misc_init_r(void)int board_init (void ) { -int offset, len; -const char *mac; - -/* take a copy of the firmware information (the user could unknownly -overwrite that DDR via tftp or other means) */ - - offset =fdt_node_offset_by_compatible (fw_dtb,-1 ,"qcom,wcnss-wlan" ); -if (offset >=0 ) { - mac =fdt_getprop (fw_dtb, offset,"local-mac-address" , &len); -if (mac) -memcpy (wlan_mac, mac,ARP_HLEN ); - } - - offset =fdt_node_offset_by_compatible (fw_dtb,-1 ,"qcom,wcnss-bt" ); -if (offset >=0 ) { - mac =fdt_getprop (fw_dtb, offset,"local-bd-address" , &len); -if (mac) -memcpy (bt_mac, mac,ARP_HLEN ); - } -return 0 ; }int ft_board_setup (void *blob,bd_t *bd) { -do_fixup_by_compat (blob,"qcom,wcnss-wlan" ,"local-mac-address" , - wlan_mac,ARP_HLEN ,1 ); - -do_fixup_by_compat (blob,"qcom,wcnss-bt" ,"local-bd-address" , - bt_mac,ARP_HLEN ,1 ); +int offset, len, i; +const char *mac; +struct { +const char *compatible; +const char *property; + } fix[] = { + [0 ] = { +/* update the kernel's dtb with wlan mac */ + .compatible ="qcom,wcnss-wlan" , + .property ="local-mac-address" , + }, + [1 ] = { +/* update the kernel's dtb with bt mac */ + .compatible ="qcom,wcnss-bt" , + .property ="local-bd-address" , + }, + }; + +for ( i =0 ; i <sizeof (fix)/sizeof (fix[0 ]); i++) { + + offset =fdt_node_offset_by_compatible (gd->fdt_blob,-1 , + fix[i].compatible); +if (offset <0 ) +continue ; + + mac =fdt_getprop (gd->fdt_blob, offset, fix[i].property, &len); +if (mac) +do_fixup_by_compat (blob, + fix[i].compatible, + fix[i].property, + mac,ARP_HLEN ,1 ); + }return 0 ; }
configs/dragonboard410c_defconfig +1 -0
@@ -47,3 +47,4 @@ CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_MMC=y CONFIG_OF_BOARD_SETUP=y CONFIG_PSCI_RESET=y +CONFIG_OF_SEPARATE=y
Signature · 1 line
2.7.4
PATCH 6/7 db410c: add reserved-memory node to dts
In reply to Jorge Ramirez-OrtizFrom: Rob Clark <[email protected]>
If lk lights up display and populates simple-framebuffer node, it will also setup a reserved-memory node (needed by simplefb on linux). But it isn't clever enough to cope when the reserved-memory node is not present.
--- arch/arm/dts/dragonboard410c.dts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/dts/dragonboard410c.dts +6 -1
@@ -23,11 +23,16 @@ reg = <0 0x80000000 0 0x3da00000>; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + }; + chosen { stdout-path = "/soc/serial at 78b0000"; }; - soc { #address-cells = <0x1>; #size-cells = <0x1>;
Signature · 1 line
2.7.4
PATCH 7/7 db410c: on aarch64 the fdtfile is in per-vendor subdirectory
In reply to Jorge Ramirez-OrtizFrom: Rob Clark <[email protected]>
--- include/configs/dragonboard410c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/dragonboard410c.h +1 -1
@@ -92,7 +92,7 @@ REFLASH(dragonboard/u-boot.img, 8)\"initrd_high=0xffffffffffffffff\0" \"linux_image=Image\0" \"kernel_addr_r=0x81000000\0" \ -"fdtfile=apq8016-sbc.dtb\0" \ +"fdtfile=qcom/apq8016-sbc.dtb\0" \"fdt_addr_r=0x83000000\0" \"ramdisk_addr_r=0x84000000\0" \"scriptaddr=0x90000000\0" \
Signature · 1 line
2.7.4
PATCH 1/7 db410c: configs: increase gunzip buffer size for the kernel
In reply to Jorge Ramirez-OrtizQuoted 5 lines · Jorge Ramirez-Ortiz
From: Jorge Ramirez-Ortiz <[email protected]>
the kernel fails to boot when it goes over the limit.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180115/927ad1b3/attachment.sig>
PATCH 2/7 db410c: update wlan and bt mac addresses from firmware
In reply to Jorge Ramirez-OrtizQuoted 10 lines · Jorge Ramirez-Ortiz
From: Jorge Ramirez-Ortiz <[email protected]>
The firmware that runs before u-boot modifies u-boot's device tree adding the local-mac-address and local-bd-address properties for the compatibles "qcom,wcnss-bt" and "qcom,wcnss-wlan".
This commit reads that firmware, retrieves the properties and fixups the device tree that is passed to the kernel before booting.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180115/d1ff3719/attachment.sig>
PATCH 3/7 db410c: replace reset driver with psci
In reply to Jorge Ramirez-OrtizQuoted 5 lines · Jorge Ramirez-Ortiz
From: Jorge Ramirez-Ortiz <[email protected]>
this should be the norm for armv8 platforms.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180115/901ce048/attachment.sig>
PATCH 4/7 fdtdec: allow board to provide fdt for CONFIG_OF_SEPARATE
In reply to Jorge Ramirez-OrtizQuoted 11 lines · Jorge Ramirez-Ortiz
From: Rob Clark <[email protected]>
Similar to
CONFIG_OF_BOARD, but in this case the fdt is still built by u-boot build. This allows the board to patch the fdt, etc.In the specific case of dragonboard 410c, we pass the u-boot generated fdt to the previous stage of bootloader (by embedding it in the u-boot.img that is loaded by lk/aboot), which patches the fdt and passes it back to u-boot.
Signed-off-by Rob Clark <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180115/8dcc4a35/attachment.sig>
PATCH 5/7 db410c: use the device tree parsed by the lk loader.
In reply to Jorge Ramirez-OrtizQuoted 6 lines · Jorge Ramirez-Ortiz
From: Jorge Ramirez-Ortiz <[email protected]>
We dont need to keep copies of the properties that we are going to fixup since we will be using the dtb provided by the firmware.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180115/a77595ae/attachment.sig>
PATCH 6/7 db410c: add reserved-memory node to dts
In reply to Jorge Ramirez-OrtizQuoted 8 lines · Jorge Ramirez-Ortiz
From: Rob Clark <[email protected]>
If lk lights up display and populates simple-framebuffer node, it will also setup a reserved-memory node (needed by simplefb on linux). But it isn't clever enough to cope when the reserved-memory node is not present.
Signed-off-by Rob Clark <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180115/839a5883/attachment.sig>
PATCH 7/7 db410c: on aarch64 the fdtfile is in per-vendor subdirectory
In reply to Jorge Ramirez-OrtizQuoted 3 lines · Jorge Ramirez-Ortiz
From: Rob Clark <[email protected]>
Signed-off-by Rob Clark <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180115/fc960e83/attachment.sig>