Refactor bur board/common code
cover Refactor bur board/common code
This patch series has the intention of preparing the move of all bur boards to driver-model, cleaning up the over years growed code, make os boot more flexible.
In another series we will make the move to DM with all its consequences (adapting drivers, ....)
For doing all this there are several things todo and some decisions regarding design were made.
decisions:
- move all boards to driver model
- no need for displaying splash/summary on linux targets
- more flexible boot process
todos:
- drop device-tree loading in common code
in future we can rely on the u-boot devicetree
- drop the device-tree based lcd initialization code
- use standard mechanism for getting mac-addresses
- new default-environment for more flexible boot
Hannes Schmelzer (12):
board/BuR: drop devicetree loading and lcd setup for linux-targets board/BuR/common: drop simple-framebuffer setup board/BuR/common: make CONFIG_LCD optional board/BuR/brppt1: drop LCD-support
board/BuR/common: remove interface Label from summary screen board/BuR/common: fix PMIC mpu-pll setup board/BuR/brppt1: drop dead code (CONFIG_SPL_OS_BOOT) board/BuR/common: refactor ft_board_setup(...) board/BuR/brppt1: implement more flexible boot process
dts: am33xx: add u-boot, dm-spl to ocp bus board/BuR/brppt1: convert brppt1 boards to driver model board/BuR/brppt1: add makerule for generating production files
arch/arm/dts/am335x-brppt1-mmc.dts | 345 ++++++++++++++++++++++++++++++ arch/arm/dts/am335x-brppt1-nand.dts | 363 ++++++++++++++++++++++++++++++++ arch/arm/dts/am335x-brppt1-spi.dts | 366 ++++++++++++++++++++++++++++++++ arch/arm/dts/am33xx.dtsi | 1 + board/BuR/brppt1/board.c | 70 ++++--- board/BuR/brppt1/config.mk | 36 ++++ board/BuR/common/common.c | 407 ++++-------------------------------- configs/brppt1_mmc_defconfig | 52 ++++- configs/brppt1_nand_defconfig | 54 ++++- configs/brppt1_spi_defconfig | 57 +++-- include/configs/brppt1.h | 202 ++++++++---------- include/configs/bur_am335x_common.h | 26 +-- scripts/config_whitelist.txt | 1 - 13 files changed, 1418 insertions(+), 562 deletions(-) create mode 100644 arch/arm/dts/am335x-brppt1-mmc.dts create mode 100644 arch/arm/dts/am335x-brppt1-nand.dts create mode 100644 arch/arm/dts/am335x-brppt1-spi.dts create mode 100644 board/BuR/brppt1/config.mk
Signature · 1 line
2.7.4
PATCH 1/12 board/BuR: drop devicetree loading and lcd setup for linux-targets
This patch drops the lcd-screen setup, the summary screen and getting mac-addresses based on a previous loaded device-tree for linux targets. Selecting those linux target is simple, since we have only the brppt1.
In detail we do:
- drop the common lcd-setup code which relys on a fdt_blob
- drop the common dtb loading mechanism
- drop the now obsolete CONFIG_USE_FDT from board header and whitelist.
---
board/BuR/common/common.c | 230 ++----------------------------------------- include/configs/brppt1.h | 1 - scripts/config_whitelist.txt | 1 - 3 files changed, 6 insertions(+), 226 deletions(-)
board/BuR/common/common.c +6 -224
@@ -26,42 +26,22 @@#include <cpsw.h> #include <power/tps65217.h> #include <lcd.h> -#include <fs.h> -#ifdef CONFIG_USE_FDT -#include <fdt_support.h> -#endif #include "bur_common.h" #include "../../../drivers/video/am335x-fb.h" -#include <nand.h> #include <fdt_simplefb.h> static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE ;DECLARE_GLOBAL_DATA_PTR ; -#ifdef CONFIG_USE_FDT -#define FDTPROP (b, c) fdt_getprop_u32_default(gd->fdt_blob, b, c, ~0UL) -#define PATHTIM "/panel/display-timings/default" -#define PATHINF "/panel/panel-info" -#endif /* --------------------------------------------------------------------------*/ #if defined(CONFIG_LCD ) && defined(CONFIG_AM335X_LCD ) && \ !defined(CONFIG_SPL_BUILD )void lcdbacklight (int on) { -#ifdef CONFIG_USE_FDT -if (gd->fdt_blob ==NULL ) { -printf ("%s: don't have a valid gd->fdt_blob!\n" , __func__); -return ; - } -unsigned int driver =FDTPROP (PATHINF ,"brightdrv" ); -unsigned int bright =FDTPROP (PATHINF ,"brightdef" ); -unsigned int pwmfrq =FDTPROP (PATHINF ,"brightfdim" ); -#else unsigned int driver =env_get_ulong ("ds1_bright_drv" ,16 ,0UL );unsigned int bright =env_get_ulong ("ds1_bright_def" ,10 ,50 );unsigned int pwmfrq =env_get_ulong ("ds1_pwmfreq" ,10 , ~0UL ); -#endif unsigned int tmp;struct gptimer *timerhw;
@@ -116,70 +96,7 @@ void lcdbacklight(int on)int load_lcdtiming (struct am335x_lcdpanel *panel) {struct am335x_lcdpanel pnltmp; -#ifdef CONFIG_USE_FDT -u32 dtbprop; -char buf[32 ]; -const char *nodep =0 ; -int nodeoff; - -if (gd->fdt_blob ==NULL ) { -printf ("%s: don't have a valid gd->fdt_blob!\n" , __func__); -return -1 ; - } -memcpy (&pnltmp, (void *)panel,sizeof (struct am335x_lcdpanel )); - - pnltmp.hactive =FDTPROP (PATHTIM ,"hactive" ); - pnltmp.vactive =FDTPROP (PATHTIM ,"vactive" ); - pnltmp.bpp =FDTPROP (PATHINF ,"bpp" ); - pnltmp.hfp =FDTPROP (PATHTIM ,"hfront-porch" ); - pnltmp.hbp =FDTPROP (PATHTIM ,"hback-porch" ); - pnltmp.hsw =FDTPROP (PATHTIM ,"hsync-len" ); - pnltmp.vfp =FDTPROP (PATHTIM ,"vfront-porch" ); - pnltmp.vbp =FDTPROP (PATHTIM ,"vback-porch" ); - pnltmp.vsw =FDTPROP (PATHTIM ,"vsync-len" ); - pnltmp.pup_delay =FDTPROP (PATHTIM ,"pupdelay" ); - pnltmp.pon_delay =FDTPROP (PATHTIM ,"pondelay" ); - pnltmp.pxl_clk =FDTPROP (PATHTIM ,"clock-frequency" ); - -/* check polarity of control-signals */ - dtbprop =FDTPROP (PATHTIM ,"hsync-active" ); -if (dtbprop ==0 ) - pnltmp.pol |=HSYNC_INVERT ; - dtbprop =FDTPROP (PATHTIM ,"vsync-active" ); -if (dtbprop ==0 ) - pnltmp.pol |=VSYNC_INVERT ; - dtbprop =FDTPROP (PATHINF ,"sync-ctrl" ); -if (dtbprop ==1 ) - pnltmp.pol |=HSVS_CONTROL ; - dtbprop =FDTPROP (PATHINF ,"sync-edge" ); -if (dtbprop ==1 ) - pnltmp.pol |=HSVS_RISEFALL ; - dtbprop =FDTPROP (PATHTIM ,"pixelclk-active" ); -if (dtbprop ==0 ) - pnltmp.pol |=PXCLK_INVERT ; - dtbprop =FDTPROP (PATHTIM ,"de-active" ); -if (dtbprop ==0 ) - pnltmp.pol |=DE_INVERT ; - - nodeoff =fdt_path_offset (gd->fdt_blob,"/factory-settings" ); -if (nodeoff >=0 ) { - nodep =fdt_getprop (gd->fdt_blob, nodeoff,"rotation" ,NULL ); -if (nodep !=0 ) { -if (strcmp (nodep,"cw" ) ==0 ) - panel_info.vl_rot =1 ; -else if (strcmp (nodep,"ud" ) ==0 ) - panel_info.vl_rot =2 ; -else if (strcmp (nodep,"ccw" ) ==0 ) - panel_info.vl_rot =3 ; -else - panel_info.vl_rot =0 ; - } - }else { -puts ("no 'factory-settings / rotation' in dtb!\n" ); - } -snprintf (buf,sizeof (buf),"fbcon=rotate:%d" , panel_info.vl_rot); -env_set ("optargs_rot" , buf); -#else + pnltmp.hactive =env_get_ulong ("ds1_hactive" ,10 , ~0UL ); pnltmp.vactive =env_get_ulong ("ds1_vactive" ,10 , ~0UL ); pnltmp.bpp =env_get_ulong ("ds1_bpp" ,10 , ~0UL );
@@ -194,7 +111,7 @@ int load_lcdtiming(struct am335x_lcdpanel *panel) pnltmp.pup_delay =env_get_ulong ("ds1_pupdelay" ,10 , ~0UL ); pnltmp.pon_delay =env_get_ulong ("ds1_tondelay" ,10 , ~0UL ); panel_info.vl_rot =env_get_ulong ("ds1_rotation" ,10 ,0 ); -#endif + if ( ~0UL == (pnltmp.hactive) || ~0UL == (pnltmp.vactive) ||
@@ -240,117 +157,6 @@ int load_lcdtiming(struct am335x_lcdpanel *panel)return 0 ; } -#ifdef CONFIG_USE_FDT -static int load_devicetree (void ) -{ -int rc; -loff_t dtbsize; -u32 dtbaddr =env_get_ulong ("dtbaddr" ,16 ,0UL ); - -if (dtbaddr ==0 ) { -printf ("%s: don't have a valid <dtbaddr> in env!\n" , __func__); -return -1 ; - } -#ifdef CONFIG_NAND - dtbsize =0x20000 ; - rc =nand_read_skip_bad (get_nand_dev_by_index (0 ),0x40000 , - (size_t *)&dtbsize, -NULL ,0x20000 , (u_char *)dtbaddr); -#else -char *dtbname =env_get ("dtb" ); -char *dtbdev =env_get ("dtbdev" ); -char *dtbpart =env_get ("dtbpart" ); -if (!dtbdev || !dtbpart || !dtbname) { -printf ("%s: <dtbdev>/<dtbpart>/<dtb> missing.\n" , __func__); -return -1 ; - } - -if (fs_set_blk_dev (dtbdev, dtbpart,FS_TYPE_EXT )) { -puts ("load_devicetree: set_blk_dev failed.\n" ); -return -1 ; - } - rc =fs_read (dtbname, (u32 )dtbaddr,0 ,0 , &dtbsize); -#endif -if (rc ==0 ) { - gd->fdt_blob = (void *)dtbaddr; - gd->fdt_size = dtbsize; -debug ("loaded %d bytes of dtb onto 0x%08x\n" , - (u32 )dtbsize, (u32 )gd->fdt_blob); -return dtbsize; - } - -printf ("%s: load dtb failed!\n" , __func__); -return -1 ; -} - -static const char *dtbmacaddr (u32 ifno) -{ -int node, len; -char enet[16 ]; -const char *mac; -const char *path; - -if (gd->fdt_blob ==NULL ) { -printf ("%s: don't have a valid gd->fdt_blob!\n" , __func__); -return NULL ; - } - - node =fdt_path_offset (gd->fdt_blob,"/aliases" ); -if (node <0 ) -return NULL ; - -sprintf (enet,"ethernet%d" , ifno); - path =fdt_getprop (gd->fdt_blob, node, enet,NULL ); -if (!path) { -printf ("no alias for %s\n" , enet); -return NULL ; - } - - node =fdt_path_offset (gd->fdt_blob, path); - mac =fdt_getprop (gd->fdt_blob, node,"mac-address" , &len); -if (mac &&is_valid_ethaddr ((u8 *)mac)) -return mac; - -return NULL ; -} - -static void br_summaryscreen_printdtb (char *prefix, -char *name, -char *suffix) -{ -char buf[32 ] = {0 }; -const char *nodep = buf; -char *mac =0 ; -int nodeoffset; -int len; - -if (gd->fdt_blob ==NULL ) { -printf ("%s: don't have a valid gd->fdt_blob!\n" , __func__); -return ; - } - -if (strcmp (name,"brmac1" ) ==0 ) { - mac = (char *)dtbmacaddr (0 ); -if (mac) -sprintf (buf,"%pM" , mac); - }else if (strcmp (name,"brmac2" ) ==0 ) { - mac = (char *)dtbmacaddr (1 ); -if (mac) -sprintf (buf,"%pM" , mac); - }else { - nodeoffset =fdt_path_offset (gd->fdt_blob, -"/factory-settings" ); -if (nodeoffset <0 ) { -puts ("no 'factory-settings' in dtb!\n" ); -return ; - } - nodep =fdt_getprop (gd->fdt_blob, nodeoffset, name, &len); - } -if (nodep &&strlen (nodep) >1 ) -lcd_printf ("%s %s %s" , prefix, nodep, suffix); -else -lcd_printf ("\n" ); -}int ft_board_setup (void *blob,bd_t *bd) {int nodeoffset;
@@ -393,7 +199,6 @@ int ft_board_setup(void *blob, bd_t *bd)return 0 ; } -#else static void br_summaryscreen_printenv(char *prefix, char *name, char *altname,
@@ -410,39 +215,23 @@ static void br_summaryscreen_printenv(char *prefix,lcd_printf ("\n" ); } } -#endif +void br_summaryscreen (void ) { -#ifdef CONFIG_USE_FDT -br_summaryscreen_printdtb (" - B&R -" ,"order-no" ,"-\n" ); -br_summaryscreen_printdtb (" Serial/Rev :" ,"serial-no" ," /" ); -br_summaryscreen_printdtb (" " ,"hw-revision" ,"\n" ); -br_summaryscreen_printdtb (" MAC (IF1) :" ,"brmac1" ,"\n" ); -br_summaryscreen_printdtb (" MAC (IF2) :" ,"brmac2" ,"\n" ); -lcd_puts (" Bootloader : " PLAIN_VERSION "\n" ); -lcd_puts ("\n" ); -#else br_summaryscreen_printenv (" - B&R -" ,"br_orderno" ,0 ,"-\n" );br_summaryscreen_printenv (" Serial/Rev :" ,"br_serial" ,0 ,"\n" );br_summaryscreen_printenv (" MAC (IF1) :" ,"br_mac1" ,"ethaddr" ,"\n" );br_summaryscreen_printenv (" MAC (IF2) :" ,"br_mac2" ,0 ,"\n" );lcd_puts (" Bootloader : " PLAIN_VERSION "\n" );lcd_puts ("\n" ); -#endif }void lcdpower (int on) {u32 pin, swval, i; -#ifdef CONFIG_USE_FDT -if (gd->fdt_blob ==NULL ) { -printf ("%s: don't have a valid gd->fdt_blob!\n" , __func__); -return ; - } - pin =FDTPROP (PATHINF ,"pwrpin" ); -#else + pin =env_get_ulong ("ds1_pwr" ,16 , ~0UL ); -#endif +if (pin == ~0UL ) {puts ("no pwrpin in dtb/env, cannot powerup display!\n" );return ;
@@ -475,10 +264,7 @@ vidinfo_t panel_info = {void lcd_ctrl_init (void *lcdbase) {struct am335x_lcdpanel lcd_panel; -#ifdef CONFIG_USE_FDT -/* TODO: is there a better place to load the dtb ? */ -load_devicetree (); -#endif +memset (&lcd_panel,0 ,sizeof (struct am335x_lcdpanel ));if (load_lcdtiming (&lcd_panel) !=0 )return ;
@@ -652,10 +438,6 @@ int board_eth_init(bd_t *bis) mac_addr[5 ] = (mac_lo &0xFF00 ) >>8 ;if (!env_get ("ethaddr" )) { -#if !defined(CONFIG_SPL_BUILD ) && defined(CONFIG_USE_FDT ) -printf ("<ethaddr> not set. trying DTB ... " ); - mac =dtbmacaddr (0 ); -#endif if (!mac) {printf ("<ethaddr> not set. validating E-fuse MAC ... " );if (is_valid_ethaddr ((const u8 *)mac_addr))
include/configs/brppt1.h +0 -1
@@ -29,7 +29,6 @@#define CONFIG_POWER_TPS65217 /* Support both device trees and ATAGs. */ -#define CONFIG_USE_FDT /* use fdt within board code */ #define CONFIG_CMDLINE_TAG #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG
scripts/config_whitelist.txt +0 -1
@@ -4682,7 +4682,6 @@ CONFIG_USB_XHCI_EXYNOS CONFIG_USB_XHCI_KEYSTONE CONFIG_USB_XHCI_OMAP CONFIG_USER_LOWLEVEL_INIT -CONFIG_USE_FDT CONFIG_USE_INTERRUPT CONFIG_USE_NAND CONFIG_USE_NOR
Signature · 1 line
2.7.4
PATCH 1/12 board/BuR: drop devicetree loading and lcd setup for linux-targets
Quoted 10 lines · Hannes Schmelzer
This patch drops the lcd-screen setup, the summary screen and getting mac-addresses based on a previous loaded device-tree for linux targets. Selecting those linux target is simple, since we have only the brppt1.
In detail we do:
- drop the common lcd-setup code which relys on afdt_blob
- drop the common dtb loading mechanism
- drop the now obsoleteCONFIG_USE_FDTfrom board header and whitelist.Signed-off-by Hannes Schmelzer <[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/20180720/d0c06bb9/attachment.sig>
PATCH 2/12 board/BuR/common: drop simple-framebuffer setup
In reply to Hannes SchmelzerThe linux systems running on the brppt1 targets are using modern DRM drivers since long time ago. Further we are going to drop the LCD support completely on this board, so the simple-framebuffer setup becomes obsolete.
---
board/BuR/common/common.c | 26 -------------------------- 1 file changed, 26 deletions(-)
board/BuR/common/common.c +0 -26
@@ -28,7 +28,6 @@#include <lcd.h> #include "bur_common.h" #include "../../../drivers/video/am335x-fb.h" -#include <fdt_simplefb.h> static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE ;
@@ -171,31 +170,6 @@ int ft_board_setup(void *blob, bd_t *bd)puts ("set bootloader version 'bl-version' prop. not in dtb!\n" );return -1 ; } -/* -* if no simplefb is requested through environment, we don't set up -* one, instead we turn off backlight. -*/ -if (env_get_ulong ("simplefb" ,10 ,0 ) ==0 ) { -lcdbacklight (0 ); -return 0 ; - } -/* Setup simplefb devicetree node, also adapt memory-node, -* upper limit for kernel e.g. linux is memtop-framebuffer alligned -* to a full megabyte. -*/ -u64 start = gd->bd->bi_dram[0 ].start; -u64 size = (gd->fb_base - start) & ~0xFFFFF ; -int rc =fdt_fixup_memory_banks (blob, &start, &size,1 ); - -if (rc) { -puts ("cannot setup simplefb: Error reserving memory!\n" ); -return rc; - } - rc =lcd_dt_simplefb_enable_existing_node (blob); -if (rc) { -puts ("cannot setup simplefb: error enabling simplefb node!\n" ); -return rc; - }return 0 ; }
Signature · 1 line
2.7.4
PATCH 2/12 board/BuR/common: drop simple-framebuffer setup
Quoted 6 lines · Hannes Schmelzer
The linux systems running on the brppt1 targets are using modern DRM drivers since long time ago. Further we are going to drop the LCD support completely on this board, so the simple-framebuffer setup becomes obsolete.
Signed-off-by Hannes Schmelzer <[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/20180720/7f462399/attachment.sig>
PATCH 3/12 board/BuR/common: make CONFIG_LCD optional
In reply to Hannes SchmelzerSince we're going to drop LCD-support on brppt1 boards, we have to make this stuff here optional and remove the #error path.
We also move out the ft_board_setup(...) from this #ifdef because there's no relationship with the LCD-code and on the other hand this is still needed in future even with LCD-support off.
---
board/BuR/common/common.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-)
board/BuR/common/common.c +18 -21
@@ -156,24 +156,6 @@ int load_lcdtiming(struct am335x_lcdpanel *panel)return 0 ; } -int ft_board_setup (void *blob,bd_t *bd) -{ -int nodeoffset; - - nodeoffset =fdt_path_offset (blob,"/factory-settings" ); -if (nodeoffset <0 ) { -puts ("set bootloader version 'factory-settings' not in dtb!\n" ); -return -1 ; - } -if (fdt_setprop (blob, nodeoffset,"bl-version" , -PLAIN_VERSION ,strlen (PLAIN_VERSION )) !=0 ) { -puts ("set bootloader version 'bl-version' prop. not in dtb!\n" ); -return -1 ; - } - -return 0 ; -} -static void br_summaryscreen_printenv (char *prefix,char *name,char *altname,char *suffix)
@@ -262,11 +244,26 @@ void lcd_enable(void)br_summaryscreen ();lcdbacklight (1 ); } -#elif CONFIG_SPL_BUILD -#else -#error "LCD-support with a suitable FB-Driver is mandatory !"#endif /* CONFIG_LCD */ +int ft_board_setup (void *blob,bd_t *bd) +{ +int nodeoffset; + + nodeoffset =fdt_path_offset (blob,"/factory-settings" ); +if (nodeoffset <0 ) { +puts ("set bootloader version 'factory-settings' not in dtb!\n" ); +return -1 ; + } +if (fdt_setprop (blob, nodeoffset,"bl-version" , +PLAIN_VERSION ,strlen (PLAIN_VERSION )) !=0 ) { +puts ("set bootloader version 'bl-version' prop. not in dtb!\n" ); +return -1 ; + } + +return 0 ; +} +#ifdef CONFIG_SPL_BUILD void pmicsetup (u32 mpupll) {
Signature · 1 line
2.7.4
PATCH 3/12 board/BuR/common: make CONFIG_LCD optional
Quoted 8 lines · Hannes Schmelzer
Since we're going to drop LCD-support on brppt1 boards, we have to make this stuff here optional and remove the #error path.
We also move out the
ft_board_setup(...)from this #ifdef because there's no relationship with the LCD-code and on the other hand this is still needed in future even with LCD-support off.Signed-off-by Hannes Schmelzer <[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/20180720/5fd31e61/attachment.sig>
PATCH 4/12 board/BuR/brppt1: drop LCD-support
In reply to Hannes SchmelzerOn this linux target long time ago the OS is using DRM driver for handling video output, the pre initialization of u-boot and the display summary screen is obsolete. With this patch we drop the LCD-support from thisd board.
---
board/BuR/brppt1/board.c | 4 ---- configs/brppt1_mmc_defconfig | 3 --- configs/brppt1_nand_defconfig | 3 --- configs/brppt1_spi_defconfig | 3 --- include/configs/brppt1.h | 5 ----- 5 files changed, 18 deletions(-)
board/BuR/brppt1/board.c +0 -4
@@ -26,7 +26,6 @@#include <i2c.h> #include <power/tps65217.h> #include "../common/bur_common.h" -#include <lcd.h> #include <watchdog.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -160,9 +159,6 @@ int board_init(void)int board_late_init (void ) {if (0 ==gpio_get_value (REPSWITCH )) { -lcd_position_cursor (1 ,8 ); -lcd_puts ( -"switching to network-console ... " );env_set ("bootcmd" ,"run netconsole" ); }return 0 ;
configs/brppt1_mmc_defconfig +0 -3
@@ -11,7 +11,6 @@ CONFIG_SPL=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,EMMC_BOOT" CONFIG_BOOTDELAY=-2 -# CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y CONFIG_SYS_CONSOLE_INFO_QUIET=y
@@ -57,7 +56,5 @@ CONFIG_USB=y CONFIG_USB_MUSB_HOST=y CONFIG_USB_MUSB_DSPS=y CONFIG_USB_STORAGE=y -CONFIG_SYS_WHITE_ON_BLACK=y -CONFIG_LCD=y CONFIG_FAT_WRITE=y CONFIG_OF_LIBFDT=y
configs/brppt1_nand_defconfig +0 -3
@@ -10,7 +10,6 @@ CONFIG_SPL=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1" CONFIG_BOOTDELAY=-2 -# CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y CONFIG_SYS_CONSOLE_INFO_QUIET=y
@@ -59,7 +58,5 @@ CONFIG_USB=y CONFIG_USB_MUSB_HOST=y CONFIG_USB_MUSB_DSPS=y CONFIG_USB_STORAGE=y -CONFIG_SYS_WHITE_ON_BLACK=y -CONFIG_LCD=y CONFIG_FAT_WRITE=y CONFIG_OF_LIBFDT=y
configs/brppt1_spi_defconfig +0 -3
@@ -14,7 +14,6 @@ CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,SPI_BOOT,EMMC_BOOT" CONFIG_SPI_BOOT=y CONFIG_BOOTDELAY=-2 -# CONFIG_CONSOLE_MUX is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y CONFIG_SYS_CONSOLE_INFO_QUIET=y
@@ -69,7 +68,5 @@ CONFIG_USB=y CONFIG_USB_MUSB_HOST=y CONFIG_USB_MUSB_DSPS=y CONFIG_USB_STORAGE=y -CONFIG_SYS_WHITE_ON_BLACK=y -CONFIG_LCD=y CONFIG_FAT_WRITE=y CONFIG_OF_LIBFDT=y
include/configs/brppt1.h +0 -5
@@ -14,11 +14,6 @@#include <configs/bur_cfg_common.h> #include <configs/bur_am335x_common.h> /* ------------------------------------------------------------------------- */ -#define CONFIG_AM335X_LCD -#define CONFIG_LCD_ROTATION -#define CONFIG_LCD_DT_SIMPLEFB -#define LCD_BPP LCD_COLOR32 -/* memory */ #define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024)
Signature · 1 line
2.7.4
PATCH 4/12 board/BuR/brppt1: drop LCD-support
Quoted 6 lines · Hannes Schmelzer
On this linux target long time ago the OS is using DRM driver for handling video output, the pre initialization of u-boot and the display summary screen is obsolete. With this patch we drop the LCD-support from thisd board.
Signed-off-by Hannes Schmelzer <[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/20180720/aeb55b8a/attachment.sig>
PATCH 5/12 board/BuR/common: remove interface Label from summary screen
In reply to Hannes SchmelzerThis interface names may vary over different products, to consider this fact we replace the interface label "IF1" and "IF2" on the summary screen with some more generic wording "MAC1" and "MAC2".
---
board/BuR/common/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
board/BuR/common/common.c +2 -2
@@ -176,8 +176,8 @@ void br_summaryscreen(void) {br_summaryscreen_printenv (" - B&R -" ,"br_orderno" ,0 ,"-\n" );br_summaryscreen_printenv (" Serial/Rev :" ,"br_serial" ,0 ,"\n" ); -br_summaryscreen_printenv (" MAC (IF1) :" ,"br_mac1" ,"ethaddr" ,"\n" ); -br_summaryscreen_printenv (" MAC (IF2) :" ,"br_mac2" ,0 ,"\n" ); +br_summaryscreen_printenv (" MAC1 :" ,"br_mac1" ,"ethaddr" ,"\n" ); +br_summaryscreen_printenv (" MAC2 :" ,"br_mac2" ,0 ,"\n" );lcd_puts (" Bootloader : " PLAIN_VERSION "\n" );lcd_puts ("\n" ); }
Signature · 1 line
2.7.4
PATCH 5/12 board/BuR/common: remove interface Label from summary screen
Quoted 5 lines · Hannes Schmelzer
This interface names may vary over different products, to consider this fact we replace the interface label "IF1" and "IF2" on the summary screen with some more generic wording "MAC1" and "MAC2".
Signed-off-by Hannes Schmelzer <[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/20180720/49cf87a2/attachment.sig>
PATCH 6/12 board/BuR/common: fix PMIC mpu-pll setup
In reply to Hannes SchmelzerIf a board-code calls the pmicsetup(u32 mpupll) with a mpupll value != 0 it wants to force some frequency with the value provided by mpupll. Setting up 1 GHz is wrong here.
Nobody did take notice about that yet, since every board calls this function with zero.
---
board/BuR/common/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/BuR/common/common.c +1 -1
@@ -280,7 +280,7 @@ void pmicsetup(u32 mpupll)printf ("detected max. frequency: %d - " , dpll_mpu_opp100.m);if (0 != mpupll) { - dpll_mpu_opp100.m =MPUPLL_M_1000 ; + dpll_mpu_opp100.m = mpupll;printf ("retuning MPU-PLL to: %d MHz.\n" , dpll_mpu_opp100.m); }else {puts ("ok.\n" );
Signature · 1 line
2.7.4
PATCH 6/12 board/BuR/common: fix PMIC mpu-pll setup
Quoted 8 lines · Hannes Schmelzer
If a board-code calls the pmicsetup(u32 mpupll) with a mpupll value != 0 it wants to force some frequency with the value provided by mpupll. Setting up 1 GHz is wrong here.
Nobody did take notice about that yet, since every board calls this function with zero.
Signed-off-by Hannes Schmelzer <[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/20180720/f7382a36/attachment.sig>
PATCH 7/12 board/BuR/brppt1: drop dead code (CONFIG_SPL_OS_BOOT)
In reply to Hannes SchmelzerThe falcon mode was never used on this board, there is also no plan to use it. So drop this dead code.
---
board/BuR/brppt1/board.c | 16 ---------------- include/configs/brppt1.h | 14 -------------- 2 files changed, 30 deletions(-)
board/BuR/brppt1/board.c +0 -16
@@ -72,22 +72,6 @@ static const struct ctrl_ioregs ddr3_ioregs = { .dt1ioctl = MT41K256M16HA125E_IOCTRL_VALUE, }; -#ifdef CONFIG_SPL_OS_BOOT -/* -* called from spl_nand.c -* return 0 for loading linux, return 1 for loading u-boot -*/ -int spl_start_uboot (void ) -{ -if (0 ==gpio_get_value (REPSWITCH )) { -mdelay (1000 ); -printf ("SPL: entering u-boot instead kernel image.\n" ); -return 1 ; - } -return 0 ; -} -#endif /* CONFIG_SPL_OS_BOOT */ -#define OSC (V_OSCK/1000000)static const struct dpll_params dpll_ddr3 = {400 ,OSC -1 ,1 ,-1 ,-1 ,-1 ,-1 };
include/configs/brppt1.h +0 -14
@@ -44,20 +44,6 @@#define CONFIG_MTD_DEVICE /* Required for mtdparts */ #endif /* CONFIG_SPI_BOOT, ... */ -#ifdef CONFIG_SPL_OS_BOOT -#define CONFIG_SYS_SPL_ARGS_ADDR 0x80F80000 - -/* RAW SD card / eMMC */ -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x900/* address 0x120000 */ -#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x80/* address 0x10000 */ -#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80/* 64KiB */ - -/* NAND */ -#ifdef CONFIG_NAND -#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x140000 -#endif /* CONFIG_NAND */ -#endif /* CONFIG_SPL_OS_BOOT */ -#ifdef CONFIG_NAND #define CONFIG_SPL_NAND_BASE #define CONFIG_SPL_NAND_DRIVERS
Signature · 1 line
2.7.4
PATCH 7/12 board/BuR/brppt1: drop dead code (CONFIG_SPL_OS_BOOT)
Quoted 4 lines · Hannes Schmelzer
The falcon mode was never used on this board, there is also no plan to use it. So drop this dead code.
Signed-off-by Hannes Schmelzer <[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/20180720/f55d8c24/attachment.sig>
PATCH 8/12 board/BuR/common: refactor ft_board_setup(...)
In reply to Hannes SchmelzerOn other OS, not one provided by B&R, it is not guaranteed that there are factory-settings within a devicetree. So we must not treat the absence of them as error.
Further we've the fact that on different version of the device-tree files there are different namings of the factory-settings, we consider this with searching for an alternative name.
changing things as following:
- don't treat as error if the bootloader version cannot written into devicetree.
- since the naming of the factory-settings are different in different versions of the provided device-tree we search for the alternate name "/fset"
---
board/BuR/common/common.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
board/BuR/common/common.c +10 -5
@@ -252,15 +252,20 @@ int ft_board_setup(void *blob, bd_t *bd) nodeoffset =fdt_path_offset (blob,"/factory-settings" );if (nodeoffset <0 ) { -puts ("set bootloader version 'factory-settings' not in dtb!\n" ); -return -1 ; +printf ("%s: cannot find /factory-settings, trying /fset\n" , + __func__); + nodeoffset =fdt_path_offset (blob,"/fset" ); +if (nodeoffset <0 ) { +printf ("%s: cannot find /fset.\n" , __func__); +return 0 ; + } } +if (fdt_setprop (blob, nodeoffset,"bl-version" ,PLAIN_VERSION ,strlen (PLAIN_VERSION )) !=0 ) { -puts ("set bootloader version 'bl-version' prop. not in dtb!\n" ); -return -1 ; +printf ("%s: no 'bl-version' prop in fdt!\n" , __func__); +return 0 ; } -return 0 ; }
Signature · 1 line
2.7.4
PATCH 8/12 board/BuR/common: refactor ft_board_setup(...)
Quoted 9 lines · Hannes Schmelzer
On other OS, not one provided by B&R, it is not guaranteed that there are factory-settings within a devicetree. So we must not treat the absence of them as error.
Further we've the fact that on different version of the device-tree files there are different namings of the factory-settings, we consider this with searching for an alternative name.changing things as following:
Quoted 8 lines
- don't treat as error if the bootloader version cannot written into devicetree.
- since the naming of the factory-settings are different in different versions of the provided device-tree we search for the alternate name "/fset"
Signed-off-by Hannes Schmelzer <[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/20180720/b1b81e0c/attachment.sig>
PATCH 9/12 board/BuR/brppt1: implement more flexible boot process
In reply to Hannes SchmelzerWith this commit we do:
- set the bootdelay in all brppt1 defconfigs to 0, this makes development easier, since we can break into serial console.
- move CONFIG_BOOTCOMMAND from header file to defconfig
- introduce b_mode variable for selecting the final boot-target. This b_mode represents the boot-switch, which can found on most b&r targets. On the brppt1 this boot-switch is derived from some gpio and the bootcounter within the RTC block, making it so possible to force a boot-target (as example for repair-case).
- refactor the environment for booting new flexible way primary we want to get some bootscr.img within the mass-storage, this script then loads everything needed for the boot.
For legacy reason we implement the t30lgcy#x boot targets, booting the already delivered linux-images.
- make space for the cfgscr within mtdparts on brppt1_nand
---
board/BuR/brppt1/board.c | 28 +++++++- configs/brppt1_mmc_defconfig | 4 +- configs/brppt1_nand_defconfig | 6 +- configs/brppt1_spi_defconfig | 4 +- include/configs/brppt1.h | 145 +++++++++++++++++++----------------------- 5 files changed, 102 insertions(+), 85 deletions(-)
board/BuR/brppt1/board.c +25 -3
@@ -140,11 +140,33 @@ int board_init(void) }#ifdef CONFIG_BOARD_LATE_INIT +static char *bootmodeascii[16 ] = { +"BOOT" ,"reserved" ,"reserved" ,"reserved" , +"RUN" ,"reserved" ,"reserved" ,"reserved" , +"reserved" ,"reserved" ,"reserved" ,"reserved" , +"PME" ,"reserved" ,"reserved" ,"DIAG" , +}; +int board_late_init (void ) { -if (0 ==gpio_get_value (REPSWITCH )) { -env_set ("bootcmd" ,"run netconsole" ); - } +unsigned char bmode =0 ; +ulong bootcount =0 ; + + bootcount =bootcount_load () &0xF ; + +if (gpio_get_value (REPSWITCH ) ==0 || bootcount ==12 ) + bmode =12 ; +else if (bootcount >0 ) + bmode =0 ; +else + bmode =4 ; + +printf ("Mode: %s\n" , bootmodeascii[bmode &0x0F ]); +env_set_ulong ("b_mode" , bmode); + +/* get sure that bootcmd isn't affected by any bootcount value */ +env_set_ulong ("bootlimit" ,0 ); +return 0 ; }#endif /* CONFIG_BOARD_LATE_INIT */
configs/brppt1_mmc_defconfig +3 -1
@@ -10,7 +10,9 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,EMMC_BOOT" -CONFIG_BOOTDELAY=-2 +CONFIG_BOOTDELAY=0 +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="run b_default" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y CONFIG_SYS_CONSOLE_INFO_QUIET=y
configs/brppt1_nand_defconfig +4 -2
@@ -9,7 +9,9 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1" -CONFIG_BOOTDELAY=-2 +CONFIG_BOOTDELAY=0 +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="run b_default" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y CONFIG_SYS_CONSOLE_INFO_QUIET=y
@@ -46,7 +48,7 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_CMD_MTDPARTS=y CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0" -CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:128k(MLO),128k(MLO.backup),128k(dtb),128k(u-boot-env),512k(u-boot),4m(kernel),128m(rootfs),-(user)" +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:128k(MLO),128k(cfgscr),128k(dtb),128k(u-boot-env),512k(u-boot),4m(kernel),128m(rootfs),-(user)" CONFIG_ENV_IS_IN_NAND=y CONFIG_NETCONSOLE=y CONFIG_BOOTCOUNT_LIMIT=y
configs/brppt1_spi_defconfig +3 -1
@@ -13,7 +13,9 @@ CONFIG_SPL_SPI_SUPPORT=y CONFIG_OF_BOARD_SETUP=y CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,SPI_BOOT,EMMC_BOOT" CONFIG_SPI_BOOT=y -CONFIG_BOOTDELAY=-2 +CONFIG_BOOTDELAY=0 +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="run b_default" CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y CONFIG_SYS_CONSOLE_INFO_QUIET=y
include/configs/brppt1.h +67 -78
173 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 9/12 board/BuR/brppt1: implement more flexible boot process
Quoted 19 lines · Hannes Schmelzer
With this commit we do:
- set the bootdelay in all brppt1 defconfigs to 0, this makes development easier, since we can break into serial console.
- move
CONFIG_BOOTCOMMANDfrom header file to defconfig- introduce
b_modevariable for selecting the final boot-target. Thisb_moderepresents the boot-switch, which can found on most b&r targets. On the brppt1 this boot-switch is derived from some gpio and the bootcounter within the RTC block, making it so possible to force a boot-target (as example for repair-case).- refactor the environment for booting new flexible way primary we want to get some bootscr.img within the mass-storage, this script then loads everything needed for the boot.
For legacy reason we implement the t30lgcy#x boot targets, booting the already delivered linux-images.
Quoted 3 lines
- make space for the cfgscr within mtdparts on
brppt1_nandSigned-off-by Hannes Schmelzer <[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/20180720/00269fef/attachment.sig>
PATCH 10/12 dts: am33xx: add u-boot, dm-spl to ocp bus
In reply to Hannes SchmelzerThis is needed for having access to the devices below this bus, most important is uart and boot-device (spi, mmc, ...) in SPL stage.
---
arch/arm/dts/am33xx.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/dts/am33xx.dtsi +1 -0
@@ -91,6 +91,7 @@ * the whole bus hierarchy. */ ocp { + u-boot,dm-spl; compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>;
Signature · 1 line
2.7.4
PATCH 10/12 dts: am33xx: add u-boot, dm-spl to ocp bus
Quoted 4 lines · Hannes Schmelzer
This is needed for having access to the devices below this bus, most important is uart and boot-device (spi, mmc, ...) in SPL stage.
Signed-off-by Hannes Schmelzer <[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/20180720/3bc4fe4c/attachment.sig>
PATCH 11/12 board/BuR/brppt1: convert brppt1 boards to driver model
In reply to Hannes Schmelzer- add a devicetree for each variant (mmc, spi, nand)
- drop unneeded code from board and bur/common
- drop unneeded stuff from config header files
- minor adaptions to be compliant with driver model (requesting gpio,..)
- harmonize the commandset over all brppt1 targets
---
arch/arm/dts/am335x-brppt1-mmc.dts | 345 +++++++++++++++++++++++++++++++++ arch/arm/dts/am335x-brppt1-nand.dts | 363 +++++++++++++++++++++++++++++++++++ arch/arm/dts/am335x-brppt1-spi.dts | 366 ++++++++++++++++++++++++++++++++++++ board/BuR/brppt1/board.c | 24 ++- board/BuR/common/common.c | 101 +--------- configs/brppt1_mmc_defconfig | 45 ++++- configs/brppt1_nand_defconfig | 45 ++++- configs/brppt1_spi_defconfig | 50 ++++- include/configs/brppt1.h | 37 ++-- include/configs/bur_am335x_common.h | 26 +-- 10 files changed, 1248 insertions(+), 154 deletions(-) create mode 100644 arch/arm/dts/am335x-brppt1-mmc.dts create mode 100644 arch/arm/dts/am335x-brppt1-nand.dts create mode 100644 arch/arm/dts/am335x-brppt1-spi.dts
arch/arm/dts/am335x-brppt1-mmc.dts new file +345 -0
@@ -0,0 +1,345 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018 B&R Industrial Automation GmbH + * http://www.br-automation.com + * + */ +/dts-v1/; + +#include "am33xx.dtsi" + +/ { + model = "BRPPT1 (MMC) Panel"; + compatible = "ti,am33xx"; + + fset: factory-settings { + bl-version = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456890"; + version = <0x0100>; + order-no = "6PPT30 (MMC)"; + hw-revision = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456890"; + serial-no = "0"; + device-id = <0x0>; + parent-id = <0x0>; + hw-variant = <0x1>; + }; + + aliases { + ds1bkl0 = &pwmbacklight; + ds1bkl1 = &tps_bl; + ds1timing = &timing0; + ds1ctrl = &lcdc; + gpmc = &gpmc; + mmc = &mmc2; + fset = &fset; + }; + + chosen { + bootargs = "console=ttyO0,115200 earlyprintk"; + stdout-path = &uart0; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; /* 256 MB */ + }; + + panel { + status = "disabled"; + + compatible = "ti,tilcdc,panel"; + enable-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; + + backlight = <&pwmbacklight>; + bkl-pwm = <&pwmbacklight>; + bkl-tps = <&tps_bl>; + + panel-info { + ac-bias = <255>; + ac-bias-intrpt = <0>; + dma-burst-sz = <16>; + bpp = <32>; + fdd = <0x80>; + sync-edge = <0>; + sync-ctrl = <1>; + raster-order = <0>; + fifo-th = <0>; + }; + + display-timings { + native-mode = <&timing0>; + timing0: lcd { + clock-frequency = <32000000>; + hactive = <800>; + vactive = <480>; + hfront-porch = <2>; + hback-porch = <192>; + hsync-len = <1>; + vfront-porch = <20>; + vback-porch = <2>; + vsync-len = <1>; + hsync-active = <1>; + vsync-active = <1>; + pupdelay = <10>; + pondelay = <10>; + }; + }; + }; + + vmmcsd_fixed: fixedregulator at 0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + pwm0: omap-pwm at timer5 { + compatible = "ti,omap-dmtimer-pwm"; + ti,timers = <&timer5>; + #pwm-cells = <3>; + }; + + pwm1: omap-pwm at timer6 { + compatible = "ti,omap-dmtimer-pwm"; + ti,timers = <&timer6>; + #pwm-cells = <3>; + }; + + beeper: pwm-beep { + compatible = "pwm-beeper"; + pwms = <&pwm0 0 0 0>; + }; + + pwmbacklight: pwm-bkl { + compatible = "pwm-backlight"; + pwms = <&pwm1 0 5000000 0>; + + default-brightness-level = <255>; + brightness-levels = <0 16 32 64 128 170 202 234 255>; + + power-supply = <&vmmcsd_fixed>; + enable-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + }; +}; + +&uart0 { /* console uart */ + u-boot,dm-spl; + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&i2c0 { + u-boot,dm-spl; + status = "okay"; + clock-frequency = <400000>; + + tps: tps at 24 { /* PMIC controller */ + u-boot,dm-spl; + reg = <0x24>; + compatible = "ti,tps65217"; + + tps_bl: backlight { + compatible = "ti,tps65217-bl"; + isel = <1>; /* 1 - ISET1, 2 ISET2 */ + fdim = <1000>; /* TPS65217_BL_FDIM_1kHZ */ + default-brightness = <50>; + }; + }; +}; + +&i2c2 { + status = "okay"; + clock-frequency = <100000>; +}; + +&edma { + status = "okay"; +}; + +&cppi41dma { + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&usb1 { + status = "okay"; + dr_mode = "host"; +}; + +&davinci_mdio { + status = "okay"; + + phy0: ethernet-phy at 0 { + reg = <1>; + }; + + phy1: ethernet-phy at 1 { + reg = <2>; + }; +}; + +&mac { + status = "okay"; +}; + +&cpsw_emac0 { + phy-handle = <&phy0>; + dual_emac_res_vlan = <1>; + phy-mode = "mii"; +}; + +&cpsw_emac1 { + phy-handle = <&phy1>; + dual_emac_res_vlan = <2>; + phy-mode = "mii"; +}; + +&mmc1 { + u-boot,dm-spl; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <0x4>; + ti,non-removable; + ti,needs-special-hs-handling; + ti,vcc-aux-disable-is-sleep; + status = "okay"; +}; + +&mmc2 { + u-boot,dm-spl; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <0x8>; + ti,non-removable; + ti,needs-special-hs-handling; + ti,vcc-aux-disable-is-sleep; + status = "okay"; +}; + +&lcdc { + status = "disabled"; +}; + +&elm { + status = "okay"; +}; + +&sham { + status = "okay"; +}; + +&aes { + status = "okay"; +}; + +&gpio0 { + u-boot,dm-spl; + ti,no-reset-on-init; +}; + +&gpio1 { + u-boot,dm-spl; + ti,no-reset-on-init; +}; + +&gpio2 { + u-boot,dm-spl; + ti,no-reset-on-init; +}; + +&gpio3 { + u-boot,dm-spl; + ti,no-reset-on-init; +}; + +&wdt2 { + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&tscadc { + status = "okay"; + tsc { + ti,wires = <4>; + ti,x-plate-resistance = <200>; + ti,zx-cutoff-ratio = <40>; + ti,min_deviation = <60>; + ti,max_deviation = <600>; + ti,coordinate-readouts = <5>; + ti,wire-config = <0x00 0x11 0x22 0x33>; + + bnr-buttons { + Home-Button {}; + }; + }; + + adc { + ti,adc-channels = <5 6 7>; + }; +}; + +&timer6 { /* used for cpsw end device */ + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&timer7 { /* used for cpsw end device */ + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&wdt2 { + status = "okay"; + ti,no-reset-on-init; + ti,no-idle-on-init; +}; + +&epwmss0 { + status = "okay"; +}; + +&tscadc { + status = "okay"; +}; + +&dcan0 { + status = "okay"; +}; + +&dcan1 { + status = "okay"; +}; + +&sham { + status = "disabled"; +}; + +&aes { + status = "disabled"; +}; + +&rng { + status = "disabled"; +};
arch/arm/dts/am335x-brppt1-nand.dts new file +363 -0
363 lines not on this page · raw message
arch/arm/dts/am335x-brppt1-spi.dts new file +366 -0
366 lines not on this page · raw message
board/BuR/brppt1/board.c +21 -3
@@ -77,6 +77,8 @@ static const struct dpll_params dpll_ddr3 = { 400, OSC-1, 1, -1, -1, -1, -1};void am33xx_spl_board_init (void ) { +int rc; +struct cm_perpll *const cmper = (struct cm_perpll *)CM_PER ;/*struct cm_wkuppll *const cmwkup = (struct cm_wkuppll *)CM_WKUP;*/ struct cm_dpll *const cmdpll = (struct cm_dpll *)CM_DPLL ;
@@ -108,8 +110,21 @@ void am33xx_spl_board_init(void)i2c_init (CONFIG_SYS_OMAP24_I2C_SPEED ,CONFIG_SYS_OMAP24_I2C_SLAVE );pmicsetup (0 ); -gpio_direction_output (64 +29 ,1 );/* switch NAND_RnB to GPMC_WAIT1 */ -gpio_direction_output (64 +28 ,1 );/* switch MII2_CRS to GPMC_WAIT0 */ +/* peripheral reset */ + rc =gpio_request (64 +29 ,"GPMC_WAIT1" ); +if (rc !=0 ) +printf ("cannot request GPMC_WAIT1 GPIO!\n" ); + rc =gpio_direction_output (64 +29 ,1 ); +if (rc !=0 ) +printf ("cannot set GPMC_WAIT1 GPIO!\n" ); + + rc =gpio_request (64 +28 ,"GPMC_WAIT0" ); +if (rc !=0 ) +printf ("cannot request GPMC_WAIT0 GPIO!\n" ); + rc =gpio_direction_output (64 +28 ,1 ); +if (rc !=0 ) +printf ("cannot set GPMC_WAIT0 GPIO!\n" ); + }const struct dpll_params *get_dpll_ddr_params (void )
@@ -151,10 +166,13 @@ int board_late_init(void) {unsigned char bmode =0 ;ulong bootcount =0 ; +int rc; bootcount =bootcount_load () &0xF ; -if (gpio_get_value (REPSWITCH ) ==0 || bootcount ==12 ) + rc =gpio_request (REPSWITCH ,"REPSWITCH" ); + +if (rc !=0 ||gpio_get_value (REPSWITCH ) ==0 || bootcount ==12 ) bmode =12 ;else if (bootcount >0 ) bmode =0 ;
board/BuR/common/common.c +3 -98
124 lines not on this page · raw message
configs/brppt1_mmc_defconfig +39 -6
89 lines not on this page · raw message
configs/brppt1_nand_defconfig +40 -5
89 lines not on this page · raw message
configs/brppt1_spi_defconfig +42 -8
100 lines not on this page · raw message
include/configs/brppt1.h +16 -21
@@ -37,13 +37,13 @@#endif /* CONFIG_EMMC_BOOT */ /* -* When we have SPI or NAND flash we expect to be making use of mtdparts, +* When we have NAND flash we expect to be making use of mtdparts, * both for ease of use in U-Boot and for passing information on to * the Linux kernel. */ -#if defined(CONFIG_SPI_BOOT ) || defined(CONFIG_NAND ) +#if defined(CONFIG_NAND )#define CONFIG_MTD_DEVICE /* Required for mtdparts */ -#endif /* CONFIG_SPI_BOOT, ... */ +#endif #ifdef CONFIG_NAND #define CONFIG_SPL_NAND_BASE
@@ -95,7 +95,7 @@"b_tgts_pme=net usb0 mmc0 mmc1\0" \ "loaddev=mmc 1\0" -#ifdef CONFIG_MMC +#ifdef CONFIG_ENV_IS_IN_MMC #define MMCTGTS \ MMCSPI_TGTS \ "cfgscr=mmc dev 1; mmc read ${cfgaddr} 200 80; source ${cfgaddr}\0"
@@ -167,37 +167,32 @@ NANDTGTS \#define CONFIG_SYS_NAND_ECCBYTES 14#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE -#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000#define CONFIG_NAND_OMAP_GPMC_WSCFG 1#endif /* CONFIG_NAND */ /* USB configuration */ #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT -#define CONFIG_AM335X_USB0 -#define CONFIG_AM335X_USB0_MODE MUSB_HOST -#define CONFIG_AM335X_USB1 -#define CONFIG_AM335X_USB1_MODE MUSB_HOST -#if defined(CONFIG_SPI_BOOT ) -/* McSPI IP block */ -#define CONFIG_SF_DEFAULT_SPEED 24000000 - -#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000 +#if defined(CONFIG_SPI ) +/* SPI Flash */ +#define CONFIG_SF_DEFAULT_SPEED 24000000 +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x40000 +/* Environment */ #define CONFIG_SYS_REDUNDAND_ENVIRONMENT -#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED -#define CONFIG_ENV_SECT_SIZE (4 << 10)/* 4 KB sectors */ -#define CONFIG_ENV_OFFSET (768 << 10)/* 768 KiB in */ -#define CONFIG_ENV_OFFSET_REDUND (896 << 10)/* 896 KiB in */ - -#elif defined(CONFIG_EMMC_BOOT ) +#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED +#define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE +#define CONFIG_ENV_OFFSET 0x20000 +#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \ + CONFIG_ENV_SECT_SIZE) +#elif defined(CONFIG_ENV_IS_IN_MMC )#define CONFIG_SYS_MMC_ENV_DEV 1#define CONFIG_SYS_MMC_ENV_PART 2#define CONFIG_ENV_OFFSET 0x40000/* TODO: Adresse definieren */ #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)#define CONFIG_SYS_REDUNDAND_ENVIRONMENT -#elif defined(CONFIG_NAND ) +#elif defined(CONFIG_ENV_IS_IN_NAND )/* No NAND env support in SPL */ #define CONFIG_ENV_OFFSET 0x60000#define CONFIG_SYS_ENV_SECT_SIZE CONFIG_ENV_SIZE
include/configs/bur_am335x_common.h +13 -13
@@ -11,6 +11,19 @@#ifndef __BUR_AM335X_COMMON_H__#define __BUR_AM335X_COMMON_H__/* ------------------------------------------------------------------------- */ + +/* legacy #defines for non DM bur-board */ +#ifndef CONFIG_DM +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE (-4) +#define CONFIG_SYS_NS16550_CLK (48000000) +#define CONFIG_SYS_NS16550_COM1 0x44e09000 + +#define CONFIG_I2C +#define CONFIG_SYS_I2C + +#endif /* CONFIG_DM */ +#define CONFIG_MAX_RAM_BANK_SIZE (1024 << 20)/* 1GB */ /* Timer information */
@@ -20,16 +33,6 @@#include <asm/arch/omap.h> -/* NS16550 Configuration */ -#define CONFIG_SYS_NS16550_SERIAL -#define CONFIG_SYS_NS16550_REG_SIZE (-4) -#define CONFIG_SYS_NS16550_CLK 48000000 -#define CONFIG_SYS_NS16550_COM1 0x44e09000/* UART0 */ - -/* Network defines */ -#define CONFIG_MII /* Required in net/eth.c */ -#define CONFIG_PHY_NATSEMI -/* * SPL related defines. The Public RAM memory map the ROM defines the * area between 0x402F0400 and 0x4030B800 as a download area and
@@ -65,9 +68,6 @@#define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \ GENERATED_GBL_DATA_SIZE) -/* I2C */ -#define CONFIG_SYS_I2C -/* * Our platforms make use of SPL to initalize the hardware (primarily * memory) enough for full U-Boot to be loaded. We also support Falcon
Signature · 1 line
2.7.4
PATCH 11/12 board/BuR/brppt1: convert brppt1 boards to driver model
Quoted 7 lines · Hannes Schmelzer
- add a devicetree for each variant (mmc, spi, nand)
- drop unneeded code from board and bur/common
- drop unneeded stuff from config header files
- minor adaptions to be compliant with driver model (requesting gpio,..)
- harmonize the commandset over all brppt1 targetsSigned-off-by Hannes Schmelzer <[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/20180720/0fb11e3e/attachment.sig>
PATCH 12/12 board/BuR/brppt1: add makerule for generating production files
In reply to Hannes Schmelzer---
board/BuR/brppt1/config.mk | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 board/BuR/brppt1/config.mk
board/BuR/brppt1/config.mk new file +36 -0
@@ -0,0 +1,36 @@ +# +# Copyright (C) 2018 Hannes Schmelzer <[email protected]> - +# B&R Industrial Automation GmbH - http://www.br-automation.com +# +# SPDX-License-Identifier: GPL-2.0+ +# + +hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE) | sed -e 's/am335x-//') + +payload_off :=$(shell printf "%d" $(CONFIG_SYS_SPI_U_BOOT_OFFS)) + +quiet_cmd_prodbin = PRODBIN $@ $(payload_off) +cmd_prodbin = \ + dd if=/dev/zero ibs=1M count=2 2>/dev/null | tr "\000" "\377" >$@ && \ + dd conv=notrunc bs=1 if=MLO.byteswap of=$@ seek=0 2>/dev/null && \ + dd bs=1 if=u-boot-dtb.img of=$@ seek=$(payload_off) 2>/dev/null + +quiet_cmd_prodzip = SAPZIP $@ +cmd_prodzip = \ + test -d misc && rm -r misc; \ + mkdir misc && \ + cp MLO.byteswap misc/ && \ + cp spl/u-boot-spl.bin misc/ && \ + cp u-boot-dtb.img misc/ && \ + zip -9 -r $@ misc/* >/dev/null $< + +ifeq ($(hw-platform-y),brppt1-spi) +ALL-y += $(hw-platform-y)_prog.bin +ALL-y += $(hw-platform-y)_prod.zip +endif + +$(hw-platform-y)_prog.bin: u-boot-dtb.img spl/u-boot-spl.bin + $(call if_changed,prodbin) + +$(hw-platform-y)_prod.zip: $(hw-platform-y)_prog.bin + $(call if_changed,prodzip)
Signature · 1 line
2.7.4
PATCH 12/12 board/BuR/brppt1: add makerule for generating production files
Quoted 1 line · Hannes Schmelzer
Signed-off-by Hannes Schmelzer <[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/20180720/42bb05e8/attachment.sig>