From patchwork Fri Jul 6 13:41:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940508 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41MbX147ZVz9s4Z for ; Fri, 6 Jul 2018 23:42:57 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1CD9DC22055; Fri, 6 Jul 2018 13:42:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1FB93C22026; Fri, 6 Jul 2018 13:41:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 22A65C21C51; Fri, 6 Jul 2018 13:41:47 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id B23D0C21DDC for ; Fri, 6 Jul 2018 13:41:46 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id 927978F488B6; Fri, 6 Jul 2018 13:41:46 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PNG5mWT563V8; Fri, 6 Jul 2018 13:41:41 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 333358F480BF; Fri, 6 Jul 2018 13:41:40 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:18 +0200 Message-Id: <1530884489-28089-2-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 01/12] board/BuR: drop devicetree loading and lcd setup for linux-targets X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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. Signed-off-by: Hannes Schmelzer --- board/BuR/common/common.c | 230 ++----------------------------------------- include/configs/brppt1.h | 1 - scripts/config_whitelist.txt | 1 - 3 files changed, 6 insertions(+), 226 deletions(-) diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 9df1979..98132b7 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -26,42 +26,22 @@ #include #include #include -#include -#ifdef CONFIG_USE_FDT - #include -#endif #include "bur_common.h" #include "../../../drivers/video/am335x-fb.h" -#include #include 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 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: // 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(" not set. trying DTB ... "); - mac = dtbmacaddr(0); - #endif if (!mac) { printf(" not set. validating E-fuse MAC ... "); if (is_valid_ethaddr((const u8 *)mac_addr)) diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h index eb45331..a6cf9ac 100644 --- a/include/configs/brppt1.h +++ b/include/configs/brppt1.h @@ -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 diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 1219dcc..ec00d77 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -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 From patchwork Fri Jul 6 13:41:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940509 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41MbXp3Twqz9s4Z for ; Fri, 6 Jul 2018 23:43:38 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3BDD6C21DDC; Fri, 6 Jul 2018 13:42:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C1C84C2205D; Fri, 6 Jul 2018 13:42:05 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 46CB2C21FF1; Fri, 6 Jul 2018 13:41:54 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id 0F971C22054 for ; Fri, 6 Jul 2018 13:41:51 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id E239D8F488B9; Fri, 6 Jul 2018 13:41:50 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TzNv3vP4oL9j; Fri, 6 Jul 2018 13:41:45 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 56B728F480C0; Fri, 6 Jul 2018 13:41:41 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:19 +0200 Message-Id: <1530884489-28089-3-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 02/12] board/BuR/common: drop simple-framebuffer setup X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- board/BuR/common/common.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 98132b7..29430e9 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -28,7 +28,6 @@ #include #include "bur_common.h" #include "../../../drivers/video/am335x-fb.h" -#include 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; } From patchwork Fri Jul 6 13:41:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940510 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41MbY96h2hz9s4c for ; Fri, 6 Jul 2018 23:43:57 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 467DAC21DDC; Fri, 6 Jul 2018 13:42:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id F1A2FC22065; Fri, 6 Jul 2018 13:41:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 86487C21F58; Fri, 6 Jul 2018 13:41:55 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id 1232CC22046 for ; Fri, 6 Jul 2018 13:41:52 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id E93E48F48CB4; Fri, 6 Jul 2018 13:41:51 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pB9kEZgrkvie; Fri, 6 Jul 2018 13:41:46 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 107488F480C1; Fri, 6 Jul 2018 13:41:42 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:20 +0200 Message-Id: <1530884489-28089-4-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 03/12] board/BuR/common: make CONFIG_LCD optional X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- board/BuR/common/common.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 29430e9..e1ac6c4 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -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) { From patchwork Fri Jul 6 13:41:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940511 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41MbZW3BLfz9s4Z for ; Fri, 6 Jul 2018 23:45:07 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E226EC21FF1; Fri, 6 Jul 2018 13:43:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id CCE70C22028; Fri, 6 Jul 2018 13:42:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 85AC9C21F9E; Fri, 6 Jul 2018 13:42:00 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id 529CDC2205A for ; Fri, 6 Jul 2018 13:41:56 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id 327848F480C1; Fri, 6 Jul 2018 13:41:56 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 88Pqe3Ody6sO; Fri, 6 Jul 2018 13:41:51 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id C27CB8F480C2; Fri, 6 Jul 2018 13:41:42 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:21 +0200 Message-Id: <1530884489-28089-5-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 04/12] board/BuR/brppt1: drop LCD-support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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(-) diff --git a/board/BuR/brppt1/board.c b/board/BuR/brppt1/board.c index 41db449..ff2a3a2 100644 --- a/board/BuR/brppt1/board.c +++ b/board/BuR/brppt1/board.c @@ -26,7 +26,6 @@ #include #include #include "../common/bur_common.h" -#include #include 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; diff --git a/configs/brppt1_mmc_defconfig b/configs/brppt1_mmc_defconfig index a9d0f71..b8db509 100644 --- a/configs/brppt1_mmc_defconfig +++ b/configs/brppt1_mmc_defconfig @@ -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 diff --git a/configs/brppt1_nand_defconfig b/configs/brppt1_nand_defconfig index ac50abc..907ce71 100644 --- a/configs/brppt1_nand_defconfig +++ b/configs/brppt1_nand_defconfig @@ -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 diff --git a/configs/brppt1_spi_defconfig b/configs/brppt1_spi_defconfig index 140a7dd..90054aa 100644 --- a/configs/brppt1_spi_defconfig +++ b/configs/brppt1_spi_defconfig @@ -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 diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h index a6cf9ac..6a210b7 100644 --- a/include/configs/brppt1.h +++ b/include/configs/brppt1.h @@ -14,11 +14,6 @@ #include #include /* ------------------------------------------------------------------------- */ -#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) From patchwork Fri Jul 6 13:41:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940513 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41Mbb94R4Vz9s4r for ; Fri, 6 Jul 2018 23:45:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4D9C8C2207B; Fri, 6 Jul 2018 13:43:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BA428C2205C; Fri, 6 Jul 2018 13:42:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C5805C21F9E; Fri, 6 Jul 2018 13:42:01 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id 497C3C2204A for ; Fri, 6 Jul 2018 13:41:57 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id 2B4608F480C1; Fri, 6 Jul 2018 13:41:57 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wso7x3bBZwuB; Fri, 6 Jul 2018 13:41:52 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 524B28F480C3; Fri, 6 Jul 2018 13:41:43 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:22 +0200 Message-Id: <1530884489-28089-6-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 05/12] board/BuR/common: remove interface Label from summary screen X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- board/BuR/common/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index e1ac6c4..1e14a90 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -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"); } From patchwork Fri Jul 6 13:41:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940514 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41MbdY3bCbz9s4Z for ; Fri, 6 Jul 2018 23:47:45 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 09B9AC22054; Fri, 6 Jul 2018 13:46:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5F2ECC22042; Fri, 6 Jul 2018 13:42:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 362E5C22033; Fri, 6 Jul 2018 13:42:07 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id 7B3CDC22040 for ; Fri, 6 Jul 2018 13:42:01 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id 5D9598F488B6; Fri, 6 Jul 2018 13:42:01 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o+iaColMisYY; Fri, 6 Jul 2018 13:41:56 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 1FEEF8F480C4; Fri, 6 Jul 2018 13:41:44 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:23 +0200 Message-Id: <1530884489-28089-7-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 06/12] board/BuR/common: fix PMIC mpu-pll setup X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- board/BuR/common/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 1e14a90..38da36d 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -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"); From patchwork Fri Jul 6 13:41:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940512 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41Mbb83jygz9s4Z for ; Fri, 6 Jul 2018 23:45:40 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E9A27C22046; Fri, 6 Jul 2018 13:43:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8E941C21F58; Fri, 6 Jul 2018 13:42:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 89E01C2205F; Fri, 6 Jul 2018 13:42:07 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id 812D2C22057 for ; Fri, 6 Jul 2018 13:42:02 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id 612058F488B9; Fri, 6 Jul 2018 13:42:02 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JApnd1zOCP5R; Fri, 6 Jul 2018 13:41:57 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id CC77E8F488B2; Fri, 6 Jul 2018 13:41:44 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:24 +0200 Message-Id: <1530884489-28089-8-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 07/12] board/BuR/brppt1: drop dead code (CONFIG_SPL_OS_BOOT) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- board/BuR/brppt1/board.c | 16 ---------------- include/configs/brppt1.h | 14 -------------- 2 files changed, 30 deletions(-) diff --git a/board/BuR/brppt1/board.c b/board/BuR/brppt1/board.c index ff2a3a2..f970f98 100644 --- a/board/BuR/brppt1/board.c +++ b/board/BuR/brppt1/board.c @@ -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}; diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h index 6a210b7..32bb83c 100644 --- a/include/configs/brppt1.h +++ b/include/configs/brppt1.h @@ -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 From patchwork Fri Jul 6 13:41:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940521 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41MbhP3NLGz9s4r for ; Fri, 6 Jul 2018 23:50:13 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1BC5AC2202B; Fri, 6 Jul 2018 13:45:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0F1E1C22071; Fri, 6 Jul 2018 13:42:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6F63BC2206C; Fri, 6 Jul 2018 13:42:11 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id BEAD9C2202B for ; Fri, 6 Jul 2018 13:42:06 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id 9C3748F488B6; Fri, 6 Jul 2018 13:42:06 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 40lNXddwKzlA; Fri, 6 Jul 2018 13:42:01 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 4E5E18F488B3; Fri, 6 Jul 2018 13:41:45 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:25 +0200 Message-Id: <1530884489-28089-9-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 08/12] board/BuR/common: refactor ft_board_setup(...) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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: - 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 --- board/BuR/common/common.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 38da36d..01e3078 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -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; } From patchwork Fri Jul 6 13:41:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940515 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41MbfK2WK5z9s4Z for ; Fri, 6 Jul 2018 23:48:25 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 14764C2203E; Fri, 6 Jul 2018 13:44:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9CBE6C22047; Fri, 6 Jul 2018 13:42:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BF9E4C21C51; Fri, 6 Jul 2018 13:42:12 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id ED7D8C21FF1 for ; Fri, 6 Jul 2018 13:42:07 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id D109C8F488B6; Fri, 6 Jul 2018 13:42:07 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YE+IpcLu3vOr; Fri, 6 Jul 2018 13:42:02 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 111F48F480BC; Fri, 6 Jul 2018 13:41:46 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:26 +0200 Message-Id: <1530884489-28089-10-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 09/12] board/BuR/brppt1: implement more flexible boot process X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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_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 Signed-off-by: Hannes Schmelzer --- 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(-) diff --git a/board/BuR/brppt1/board.c b/board/BuR/brppt1/board.c index f970f98..87b76a6 100644 --- a/board/BuR/brppt1/board.c +++ b/board/BuR/brppt1/board.c @@ -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 */ diff --git a/configs/brppt1_mmc_defconfig b/configs/brppt1_mmc_defconfig index b8db509..6bb4657 100644 --- a/configs/brppt1_mmc_defconfig +++ b/configs/brppt1_mmc_defconfig @@ -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 diff --git a/configs/brppt1_nand_defconfig b/configs/brppt1_nand_defconfig index 907ce71..7846e55 100644 --- a/configs/brppt1_nand_defconfig +++ b/configs/brppt1_nand_defconfig @@ -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 diff --git a/configs/brppt1_spi_defconfig b/configs/brppt1_spi_defconfig index 90054aa..f4197c4 100644 --- a/configs/brppt1_spi_defconfig +++ b/configs/brppt1_spi_defconfig @@ -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 diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h index 32bb83c..d5b2573 100644 --- a/include/configs/brppt1.h +++ b/include/configs/brppt1.h @@ -16,6 +16,7 @@ /* ------------------------------------------------------------------------- */ /* memory */ #define CONFIG_SYS_MALLOC_LEN (5 * 1024 * 1024) +#define CONFIG_SYS_BOOTM_LEN SZ_32M /* Clock Defines */ #define V_OSCK 26000000 /* Clock output from T2 */ @@ -56,100 +57,88 @@ #define CONFIG_ENV_SIZE (64 << 10) #ifdef CONFIG_NAND -#define NANDARGS \ - "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ - "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ - "nandargs=setenv bootargs console=${console} " \ - "${optargs} " \ - "${optargs_rot} " \ - "root=mtd6 " \ - "rootfstype=jffs2\0" \ - "kernelsize=0x400000\0" \ - "nandboot=echo booting from nand ...; " \ - "run nandargs; " \ - "nand read ${loadaddr} kernel ${kernelsize}; " \ - "bootz ${loadaddr} - ${dtbaddr}\0" \ - "defboot=run nandboot\0" \ - "bootlimit=1\0" \ - "simplefb=1\0 " \ - "altbootcmd=run usbscript\0" +#define NANDTGTS \ +"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ +"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ +"cfgscr=nand read ${cfgaddr} cfgscr && source ${cfgaddr}\0" \ +"nandargs=setenv bootargs console=${console} ${optargs} ${optargs_rot} " \ + "root=mtd6 rootfstype=jffs2 b_mode=${b_mode}\0" \ +"b_nand=nand read ${loadaddr} kernel; nand read ${dtbaddr} dtb; " \ + "run nandargs; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \ +"b_tgts_std=usb0 nand net\0" \ +"b_tgts_rcy=net usb0 nand\0" \ +"b_tgts_pme=usb0 nand net\0" #else -#define NANDARGS "" +#define NANDTGTS "" #endif /* CONFIG_NAND */ +#define MMCSPI_TGTS \ +"t30args#0=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \ + "b_mode=${b_mode} root=/dev/mmcblk0p2 rootfstype=ext4\0" \ +"b_t30lgcy#0=" \ + "load ${loaddev}:2 ${loadaddr} /boot/PPTImage.md5 && " \ + "load ${loaddev}:2 ${loadaddr} /boot/zImage && " \ + "load ${loaddev}:2 ${dtbaddr} /boot/am335x-ppt30.dtb || " \ + "load ${loaddev}:1 ${dtbaddr} am335x-ppt30-legacy.dtb; "\ + "run t30args#0; run cfgscr; bootz ${loadaddr} - ${dtbaddr}\0" \ +"t30args#1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \ + "b_mode=${b_mode}\0" \ +"b_t30lgcy#1=" \ + "load ${loaddev}:1 ${loadaddr} zImage && " \ + "load ${loaddev}:1 ${dtbaddr} am335x-ppt30.dtb && " \ + "load ${loaddev}:1 ${ramaddr} rootfsPPT30.uboot && " \ + "run t30args#1; run cfgscr; bootz ${loadaddr} ${ramaddr} ${dtbaddr}\0" \ +"b_mmc0=load ${loaddev}:1 ${scraddr} bootscr.img && source ${scraddr}\0" \ +"b_mmc1=load ${loaddev}:1 ${scraddr} /boot/bootscr.img && source ${scraddr}\0" \ +"b_tgts_std=mmc0 mmc1 t30lgcy#0 t30lgcy#1 usb0 net\0" \ +"b_tgts_rcy=t30lgcy#1 usb0 net\0" \ +"b_tgts_pme=net usb0 mmc0 mmc1\0" \ +"loaddev=mmc 1\0" + #ifdef CONFIG_MMC -#define MMCARGS \ -"dtbdev=mmc\0" \ -"dtbpart=1:1\0" \ -"mmcroot0=setenv bootargs ${optargs_rot} ${optargs} console=${console}\0" \ -"mmcroot1=setenv bootargs ${optargs_rot} ${optargs} console=${console} " \ - "root=/dev/mmcblk0p2 rootfstype=ext4\0" \ -"mmcboot0=echo booting Updatesystem from mmc (ext4-fs) ...; " \ - "setenv simplefb 1; " \ - "ext4load mmc 1:1 ${loadaddr} /${kernel}; " \ - "ext4load mmc 1:1 ${ramaddr} /${ramdisk}; " \ - "run mmcroot0; bootz ${loadaddr} ${ramaddr} ${dtbaddr};\0" \ -"mmcboot1=echo booting PPT-OS from mmc (ext4-fs) ...; " \ - "setenv simplefb 0; " \ - "ext4load mmc 1:2 ${loadaddr} /boot/${kernel}; " \ - "run mmcroot1; bootz ${loadaddr} - ${dtbaddr};\0" \ -"defboot=ext4load mmc 1:2 ${loadaddr} /boot/PPTImage.md5 && run mmcboot1; " \ - "ext4load mmc 1:1 ${dtbaddr} /$dtb && run mmcboot0; " \ - "run ramboot; run usbscript;\0" \ -"bootlimit=1\0" \ -"altbootcmd=mmc dev 1; run mmcboot0;\0" \ -"upduboot=dhcp; " \ - "tftp ${loadaddr} MLO && mmc write ${loadaddr} 100 100; " \ - "tftp ${loadaddr} u-boot.img && mmc write ${loadaddr} 300 400;\0" +#define MMCTGTS \ +MMCSPI_TGTS \ +"cfgscr=mmc dev 1; mmc read ${cfgaddr} 200 80; source ${cfgaddr}\0" #else -#define MMCARGS "" +#define MMCTGTS "" #endif /* CONFIG_MMC */ +#ifdef CONFIG_SPI +#define SPITGTS \ +MMCSPI_TGTS \ +"cfgscr=sf probe; sf read ${cfgaddr} 0xC0000 10000; source ${cfgaddr}\0" +#else +#define SPITGTS "" +#endif /* CONFIG_SPI */ + +#define LOAD_OFFSET(x) 0x8##x + #ifndef CONFIG_SPL_BUILD #define CONFIG_EXTRA_ENV_SETTINGS \ BUR_COMMON_ENV \ "verify=no\0" \ "autoload=0\0" \ -"dtb=bur-ppt-ts30.dtb\0" \ -"dtbaddr=0x80100000\0" \ -"loadaddr=0x80200000\0" \ -"ramaddr=0x80A00000\0" \ -"kernel=zImage\0" \ -"ramdisk=rootfs.cpio.uboot\0" \ +"scraddr=" __stringify(LOAD_OFFSET(0000000)) "\0" \ +"cfgaddr=" __stringify(LOAD_OFFSET(0020000)) "\0" \ +"dtbaddr=" __stringify(LOAD_OFFSET(0040000)) "\0" \ +"loadaddr=" __stringify(LOAD_OFFSET(0100000)) "\0" \ +"ramaddr=" __stringify(LOAD_OFFSET(2000000)) "\0" \ "console=ttyO0,115200n8\0" \ "optargs=consoleblank=0 quiet panic=2\0" \ -"nfsroot=/tftpboot/tseries/rootfs-small\0" \ -"nfsopts=nolock\0" \ -"ramargs=setenv bootargs ${optargs} console=${console} root=/dev/ram0\0" \ -"netargs=setenv bootargs console=${console} " \ - "${optargs} " \ - "root=/dev/nfs " \ - "nfsroot=${serverip}:${nfsroot},${nfsopts} rw " \ - "ip=dhcp\0" \ -"netboot=echo Booting from network ...; " \ - "dhcp; " \ - "tftp ${loadaddr} ${kernel}; " \ - "tftp ${dtbaddr} ${dtb}; " \ - "run netargs; " \ - "bootz ${loadaddr} - ${dtbaddr}\0" \ -"ramboot=echo Booting from network into RAM ...; "\ - "if dhcp; then; " \ - "tftp ${loadaddr} ${kernel}; " \ - "tftp ${ramaddr} ${ramdisk}; " \ - "if ext4load ${dtbdev} ${dtbpart} ${dtbaddr} /${dtb}; " \ - "then; else tftp ${dtbaddr} ${dtb}; fi;" \ - "run mmcroot0; " \ - "bootz ${loadaddr} ${ramaddr} ${dtbaddr}; fi;\0" \ -"netupdate=echo Updating UBOOT from Network (TFTP) ...; " \ - "setenv autoload 0; " \ - "dhcp && tftp 0x80000000 updateUBOOT.img && source;\0" \ -NANDARGS \ -MMCARGS +"b_break=0\0" \ +"b_usb0=usb start && load usb 0 ${scraddr} bootscr.img && source ${scraddr}\0" \ +"b_net=tftp ${scraddr} netscript.img && source ${scraddr}\0" \ +MMCTGTS \ +SPITGTS \ +NANDTGTS \ +"b_deftgts=if test ${b_mode} = 12; then setenv b_tgts ${b_tgts_pme};" \ +" elif test ${b_mode} = 0; then setenv b_tgts ${b_tgts_rcy};" \ +" else setenv b_tgts ${b_tgts_std}; fi\0" \ +"b_default=run b_deftgts; for target in ${b_tgts};"\ +" do echo \"### booting ${target} ###\"; run b_${target};" \ +" if test ${b_break} = 1; then; exit; fi; done\0" #endif /* !CONFIG_SPL_BUILD*/ -#define CONFIG_BOOTCOMMAND \ - "mmc dev 1; run defboot;" - #ifdef CONFIG_NAND /* * GPMC block. We support 1 device and the physical address to From patchwork Fri Jul 6 13:41:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940522 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41Mbhr1XLmz9s4Z for ; Fri, 6 Jul 2018 23:50:36 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E6AB1C2203D; Fri, 6 Jul 2018 13:46:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 86D24C2206B; Fri, 6 Jul 2018 13:43:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 02A4EC22079; Fri, 6 Jul 2018 13:42:17 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id E9A65C2202A for ; Fri, 6 Jul 2018 13:42:11 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id CC67C8F488B6; Fri, 6 Jul 2018 13:42:11 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ooBS8E93WIuQ; Fri, 6 Jul 2018 13:42:06 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 82D9E8F488B5; Fri, 6 Jul 2018 13:41:46 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:27 +0200 Message-Id: <1530884489-28089-11-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer , Suniel Mahesh Subject: [U-Boot] [PATCH 10/12] dts: am33xx: add u-boot, dm-spl to ocp bus X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- arch/arm/dts/am33xx.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/dts/am33xx.dtsi b/arch/arm/dts/am33xx.dtsi index 14caee7..4234537 100644 --- a/arch/arm/dts/am33xx.dtsi +++ b/arch/arm/dts/am33xx.dtsi @@ -91,6 +91,7 @@ * the whole bus hierarchy. */ ocp { + u-boot,dm-spl; compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; From patchwork Fri Jul 6 13:41:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940516 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41Mbfv25lLz9s4Z for ; Fri, 6 Jul 2018 23:48:55 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id BC389C2201E; Fri, 6 Jul 2018 13:44:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A8EF2C2204C; Fri, 6 Jul 2018 13:42:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 78CFAC2206D; Fri, 6 Jul 2018 13:42:20 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id 9518CC2206D for ; Fri, 6 Jul 2018 13:42:14 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id 757698F488B9; Fri, 6 Jul 2018 13:42:14 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f5-+TqGLOkyt; Fri, 6 Jul 2018 13:42:07 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 1FBA28F480BF; Fri, 6 Jul 2018 13:41:47 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:28 +0200 Message-Id: <1530884489-28089-12-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Alexandru Gagniuc , Joe Hershberger , Hannes Schmelzer Subject: [U-Boot] [PATCH 11/12] board/BuR/brppt1: convert brppt1 boards to driver model X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" - 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 Signed-off-by: Hannes Schmelzer --- 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 diff --git a/arch/arm/dts/am335x-brppt1-mmc.dts b/arch/arm/dts/am335x-brppt1-mmc.dts new file mode 100644 index 0000000..9be34d9 --- /dev/null +++ b/arch/arm/dts/am335x-brppt1-mmc.dts @@ -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@0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + pwm0: omap-pwm@timer5 { + compatible = "ti,omap-dmtimer-pwm"; + ti,timers = <&timer5>; + #pwm-cells = <3>; + }; + + pwm1: omap-pwm@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@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@0 { + reg = <1>; + }; + + phy1: ethernet-phy@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"; +}; diff --git a/arch/arm/dts/am335x-brppt1-nand.dts b/arch/arm/dts/am335x-brppt1-nand.dts new file mode 100644 index 0000000..11bd5c5 --- /dev/null +++ b/arch/arm/dts/am335x-brppt1-nand.dts @@ -0,0 +1,363 @@ +// 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 (NAND) Panel"; + compatible = "ti,am33xx"; + + fset: factory-settings { + bl-version = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456890"; + version = <0x0100>; + order-no = "6PPT30 (NAND)"; + 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@0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + pwm0: omap-pwm@timer5 { + compatible = "ti,omap-dmtimer-pwm"; + ti,timers = <&timer5>; + #pwm-cells = <3>; + }; + + pwm1: omap-pwm@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@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@0 { + reg = <1>; + }; + + phy1: ethernet-phy@1 { + reg = <2>; + }; +}; + +&mac { + dual_emac; + 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"; +}; + +&mmc2 { + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <0x4>; + ti,non-removable; + ti,needs-special-hs-handling; + ti,vcc-aux-disable-is-sleep; + status = "disabled"; +}; + +&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>; + }; +}; + +&gpmc { + u-boot,dm-spl; + status = "okay"; + pinctrl-names = "default"; + ranges = <0 0 0x08000000 0x10000000>; /* CS0: NAND */ + nand@0,0 { + compatible = "ti,omap2-nand"; + reg = <0 0 4>; /* CS0, offset 0, IO size 4 */ + interrupt-parent = <&gpmc>; + rb-gpios = <&gpmc 1 GPIO_ACTIVE_HIGH>; /* gpmc_wait1 */ + ti,nand-ecc-opt = "bch8"; + ti,elm-id = <&elm>; + nand-bus-width = <8>; + gpmc,device-width = <1>; + gpmc,sync-clk-ps = <0>; + gpmc,cs-on-ns = <0>; + gpmc,cs-rd-off-ns = <44>; + gpmc,cs-wr-off-ns = <44>; + gpmc,adv-on-ns = <6>; + gpmc,adv-rd-off-ns = <34>; + gpmc,adv-wr-off-ns = <44>; + gpmc,we-on-ns = <0>; + gpmc,we-off-ns = <40>; + gpmc,oe-on-ns = <0>; + gpmc,oe-off-ns = <54>; + gpmc,access-ns = <64>; + gpmc,rd-cycle-ns = <82>; + gpmc,wr-cycle-ns = <82>; + gpmc,wait-on-read = "true"; + gpmc,wait-on-write = "true"; + gpmc,bus-turnaround-ns = <0>; + gpmc,cycle2cycle-delay-ns = <0>; + gpmc,clk-activation-ns = <0>; + gpmc,wait-monitoring-ns = <0>; + gpmc,wr-access-ns = <40>; + gpmc,wr-data-mux-bus-ns = <0>; + gpmc,wait-pin = <1>; + #address-cells = <1>; + #size-cells = <1>; + partition@0 { + label = "NAND.MLO"; + reg = <0x00000000 0x000020000>; + }; + partition@1 { + label = "NAND.cfgscr"; + reg = <0x00020000 0x00020000>; + }; + partition@2 { + label = "NAND.dtb"; + reg = <0x00040000 0x00020000>; + }; + partition@3 { + label = "NAND.u-boot-env"; + reg = <0x00060000 0x00020000>; + }; + partition@4 { + label = "NAND.u-boot"; + reg = <0x00080000 0x00080000>; + }; + partition@5 { + label = "NAND.kernel"; + reg = <0x00100000 0x00400000>; + }; + partition@6 { + label = "NAND.rootfs"; + reg = <0x00500000 0x08000000>; + }; + partition@7 { + label = "NAND.user"; + reg = <0x08500000 0x17b00000>; + }; + }; +}; diff --git a/arch/arm/dts/am335x-brppt1-spi.dts b/arch/arm/dts/am335x-brppt1-spi.dts new file mode 100644 index 0000000..522ed50 --- /dev/null +++ b/arch/arm/dts/am335x-brppt1-spi.dts @@ -0,0 +1,366 @@ +// 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 (SPI)"; + 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; + spi0 = &spi0; + 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@0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + pwm0: omap-pwm@timer5 { + compatible = "ti,omap-dmtimer-pwm"; + ti,timers = <&timer5>; + #pwm-cells = <3>; + }; + + pwm1: omap-pwm@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@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>; +}; + +&spi0 { + u-boot,dm-spl; + status = "okay"; + + cs-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>, + <&gpio0 6 GPIO_ACTIVE_HIGH>, + <0>, + <0>; + + spi-max-frequency = <24000000>; + + spi_flash: spiflash@0 { + u-boot,dm-spl; + u-boot,dm-pre-reloc; + compatible = "spidev", "spi-flash"; + spi-max-frequency = <24000000>; + reg = <0>; + }; +}; + +&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@0 { + reg = <1>; + }; + + phy1: ethernet-phy@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"; +}; diff --git a/board/BuR/brppt1/board.c b/board/BuR/brppt1/board.c index 87b76a6..d2e7c72 100644 --- a/board/BuR/brppt1/board.c +++ b/board/BuR/brppt1/board.c @@ -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; diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 01e3078..f3eae5c 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -22,15 +22,11 @@ #include #include #include -#include -#include #include #include #include "bur_common.h" #include "../../../drivers/video/am335x-fb.h" -static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; - DECLARE_GLOBAL_DATA_PTR; /* --------------------------------------------------------------------------*/ @@ -270,6 +266,9 @@ int ft_board_setup(void *blob, bd_t *bd) } #ifdef CONFIG_SPL_BUILD + +static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; + void pmicsetup(u32 mpupll) { int mpu_vdd; @@ -354,100 +353,6 @@ void set_mux_conf_regs(void) #endif /* CONFIG_SPL_BUILD */ -#if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \ - (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)) -static void cpsw_control(int enabled) -{ - /* VTP can be added here */ - return; -} - -/* describing port offsets of TI's CPSW block */ -static struct cpsw_slave_data cpsw_slaves[] = { - { - .slave_reg_ofs = 0x208, - .sliver_reg_ofs = 0xd80, - .phy_addr = 1, - }, - { - .slave_reg_ofs = 0x308, - .sliver_reg_ofs = 0xdc0, - .phy_addr = 2, - }, -}; - -static struct cpsw_platform_data cpsw_data = { - .mdio_base = CPSW_MDIO_BASE, - .cpsw_base = CPSW_BASE, - .mdio_div = 0xff, - .channels = 8, - .cpdma_reg_ofs = 0x800, - .slaves = 1, - .slave_data = cpsw_slaves, - .ale_reg_ofs = 0xd00, - .ale_entries = 1024, - .host_port_reg_ofs = 0x108, - .hw_stats_reg_ofs = 0x900, - .bd_ram_ofs = 0x2000, - .mac_control = (1 << 5), - .control = cpsw_control, - .host_port_num = 0, - .version = CPSW_CTRL_VERSION_2, -}; -#endif /* CONFIG_DRIVER_TI_CPSW, ... */ - -#if defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD) -int board_eth_init(bd_t *bis) -{ - int rv = 0; - char mac_addr[6]; - const char *mac = 0; - uint32_t mac_hi, mac_lo; - /* try reading mac address from efuse */ - mac_lo = readl(&cdev->macid0l); - mac_hi = readl(&cdev->macid0h); - mac_addr[0] = mac_hi & 0xFF; - mac_addr[1] = (mac_hi & 0xFF00) >> 8; - mac_addr[2] = (mac_hi & 0xFF0000) >> 16; - mac_addr[3] = (mac_hi & 0xFF000000) >> 24; - mac_addr[4] = mac_lo & 0xFF; - mac_addr[5] = (mac_lo & 0xFF00) >> 8; - - if (!env_get("ethaddr")) { - if (!mac) { - printf(" not set. validating E-fuse MAC ... "); - if (is_valid_ethaddr((const u8 *)mac_addr)) - mac = (const char *)mac_addr; - } - - if (mac) { - printf("using: %pM on ", mac); - eth_env_set_enetaddr("ethaddr", (const u8 *)mac); - } - } - writel(MII_MODE_ENABLE, &cdev->miisel); - cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_MII; - cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_MII; - - rv = cpsw_register(&cpsw_data); - if (rv < 0) { - printf("Error %d registering CPSW switch\n", rv); - return 0; - } - return rv; -} -#endif /* defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD) */ -#if defined(CONFIG_MMC) -int board_mmc_init(bd_t *bis) -{ - int rc = 0; - - rc |= omap_mmc_init(0, 0, 0, -1, -1); - rc |= omap_mmc_init(1, 0, 0, -1, -1); - - return rc; -} -#endif int overwrite_console(void) { return 1; diff --git a/configs/brppt1_mmc_defconfig b/configs/brppt1_mmc_defconfig index 6bb4657..3a83ecf 100644 --- a/configs/brppt1_mmc_defconfig +++ b/configs/brppt1_mmc_defconfig @@ -3,13 +3,18 @@ CONFIG_ARCH_OMAP2PLUS=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_AM33XX=y CONFIG_TARGET_BRPPT1=y CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y +# CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL=y +CONFIG_DEFAULT_DEVICE_TREE="am335x-brppt1-mmc" +CONFIG_TPL_SYS_MALLOC_F_LEN=0x0 +# CONFIG_EXPERT is not set +# CONFIG_FIT is not set CONFIG_OF_BOARD_SETUP=y -CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,EMMC_BOOT" CONFIG_BOOTDELAY=0 CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run b_default" @@ -20,8 +25,9 @@ CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_ARCH_MISC_INIT=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_I2C_SUPPORT=y -# CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SPL_YMODEM_SUPPORT=y @@ -34,29 +40,56 @@ CONFIG_CMD_BOOTZ=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y -# CONFIG_CMD_LOADB is not set # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y +CONFIG_CMD_PART=y CONFIG_CMD_USB=y # CONFIG_CMD_ITEST is not set -# CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y # CONFIG_CMD_NFS is not set +CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_BKOPS_ENABLE=y +CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +# CONFIG_SPL_DOS_PARTITION is not set +CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupt-controller interrupt-cells dma-names dmas " CONFIG_ENV_IS_IN_MMC=y -CONFIG_NETCONSOLE=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_DM=y +CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=y +# CONFIG_OF_TRANSLATE is not set CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y +CONFIG_MISC=y +CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y +CONFIG_PHY_NATSEMI=y +CONFIG_DM_ETH=y CONFIG_DRIVER_TI_CPSW=y +# CONFIG_NETDEVICES is not set +CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_MUSB_HOST=y +CONFIG_USB_MUSB_GADGET=y +CONFIG_USB_MUSB_TI=y CONFIG_USB_MUSB_DSPS=y CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y CONFIG_FAT_WRITE=y -CONFIG_OF_LIBFDT=y +CONFIG_LZO=y +# CONFIG_OF_LIBFDT_OVERLAY is not set +# CONFIG_EFI_LOADER is not set diff --git a/configs/brppt1_nand_defconfig b/configs/brppt1_nand_defconfig index 7846e55..342d31a 100644 --- a/configs/brppt1_nand_defconfig +++ b/configs/brppt1_nand_defconfig @@ -3,12 +3,16 @@ CONFIG_ARCH_OMAP2PLUS=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_AM33XX=y CONFIG_TARGET_BRPPT1=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y +CONFIG_DEFAULT_DEVICE_TREE="am335x-brppt1-nand" +CONFIG_TPL_SYS_MALLOC_F_LEN=0x0 +# CONFIG_EXPERT is not set +# CONFIG_FIT is not set CONFIG_OF_BOARD_SETUP=y -CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1" CONFIG_BOOTDELAY=0 CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run b_default" @@ -19,6 +23,9 @@ CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_ARCH_MISC_INIT=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y +# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_WATCHDOG_SUPPORT=y @@ -32,15 +39,17 @@ CONFIG_CMD_BOOTZ=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y -# CONFIG_CMD_LOADB is not set # CONFIG_CMD_LOADS is not set CONFIG_CMD_NAND=y +CONFIG_CMD_PART=y CONFIG_CMD_USB=y # CONFIG_CMD_ITEST is not set -# CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y # CONFIG_CMD_NFS is not set +CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y @@ -49,16 +58,42 @@ 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(cfgscr),128k(dtb),128k(u-boot-env),512k(u-boot),4m(kernel),128m(rootfs),-(user)" +# CONFIG_SPL_DOS_PARTITION is not set +CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupt-controller interrupt-cells dma-names dmas " CONFIG_ENV_IS_IN_NAND=y -CONFIG_NETCONSOLE=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_DM=y +CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=y +# CONFIG_OF_TRANSLATE is not set +CONFIG_BLK=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y +CONFIG_MISC=y # CONFIG_MMC is not set CONFIG_NAND=y +CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y +CONFIG_SYS_NAND_U_BOOT_OFFS=0x80000 +CONFIG_PHY_NATSEMI=y +CONFIG_DM_ETH=y CONFIG_DRIVER_TI_CPSW=y +# CONFIG_NETDEVICES is not set +CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_MUSB_HOST=y +CONFIG_USB_MUSB_GADGET=y +CONFIG_USB_MUSB_TI=y CONFIG_USB_MUSB_DSPS=y CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y CONFIG_FAT_WRITE=y -CONFIG_OF_LIBFDT=y +CONFIG_LZO=y +# CONFIG_OF_LIBFDT_OVERLAY is not set +# CONFIG_EFI_LOADER is not set diff --git a/configs/brppt1_spi_defconfig b/configs/brppt1_spi_defconfig index f4197c4..826a93c 100644 --- a/configs/brppt1_spi_defconfig +++ b/configs/brppt1_spi_defconfig @@ -3,15 +3,18 @@ CONFIG_ARCH_OMAP2PLUS=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_AM33XX=y CONFIG_TARGET_BRPPT1=y -CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y +CONFIG_DEFAULT_DEVICE_TREE="am335x-brppt1-spi" +CONFIG_TPL_SYS_MALLOC_F_LEN=0x0 +# CONFIG_EXPERT is not set +# CONFIG_FIT is not set CONFIG_OF_BOARD_SETUP=y -CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,SPI_BOOT,EMMC_BOOT" CONFIG_SPI_BOOT=y CONFIG_BOOTDELAY=0 CONFIG_USE_BOOTCOMMAND=y @@ -23,6 +26,9 @@ CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_ARCH_MISC_INIT=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +CONFIG_SPL_SEPARATE_BSS=y +# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_POWER_SUPPORT=y @@ -38,37 +44,65 @@ CONFIG_CMD_BOOTZ=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y -# CONFIG_CMD_LOADB is not set # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y +CONFIG_CMD_PART=y CONFIG_CMD_SF=y -CONFIG_CMD_SPI=y CONFIG_CMD_USB=y # CONFIG_CMD_ITEST is not set -# CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y # CONFIG_CMD_NFS is not set +CONFIG_CMD_MII=y CONFIG_CMD_PING=y +CONFIG_CMD_BOOTCOUNT=y +CONFIG_CMD_BKOPS_ENABLE=y +CONFIG_CMD_CACHE=y CONFIG_CMD_TIME=y CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y -CONFIG_CMD_MTDPARTS=y +# CONFIG_SPL_DOS_PARTITION is not set +CONFIG_OF_CONTROL=y +CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupt-controller interrupt-cells dma-names dmas " CONFIG_ENV_IS_IN_SPI_FLASH=y -CONFIG_NETCONSOLE=y +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_DM=y +CONFIG_SPL_DM=y +CONFIG_SPL_DM_SEQ_ALIAS=y +# CONFIG_OF_TRANSLATE is not set CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_I2C_COMPAT=y +CONFIG_I2C_SET_DEFAULT_BUS_NUM=y +CONFIG_MISC=y +CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y +CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y +CONFIG_SPI_FLASH_WINBOND=y # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set +CONFIG_PHY_NATSEMI=y +CONFIG_DM_ETH=y CONFIG_DRIVER_TI_CPSW=y +# CONFIG_NETDEVICES is not set +CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y CONFIG_SPI=y +CONFIG_DM_SPI=y CONFIG_OMAP3_SPI=y CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_MUSB_HOST=y +CONFIG_USB_MUSB_GADGET=y +CONFIG_USB_MUSB_TI=y CONFIG_USB_MUSB_DSPS=y CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y CONFIG_FAT_WRITE=y -CONFIG_OF_LIBFDT=y +CONFIG_LZO=y +# CONFIG_OF_LIBFDT_OVERLAY is not set +# CONFIG_EFI_LOADER is not set diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h index d5b2573..aa476f6 100644 --- a/include/configs/brppt1.h +++ b/include/configs/brppt1.h @@ -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 diff --git a/include/configs/bur_am335x_common.h b/include/configs/bur_am335x_common.h index bdcbee4..926ba99 100644 --- a/include/configs/bur_am335x_common.h +++ b/include/configs/bur_am335x_common.h @@ -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 -/* 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 From patchwork Fri Jul 6 13:41:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940523 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41Mbhs2vFDz9s4c for ; Fri, 6 Jul 2018 23:50:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 08FDAC22062; Fri, 6 Jul 2018 13:46:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 648CDC22072; Fri, 6 Jul 2018 13:42:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DDFADC22049; Fri, 6 Jul 2018 13:42:22 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id 6B9FFC22026 for ; Fri, 6 Jul 2018 13:42:17 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id 4F2AB8F48CB4; Fri, 6 Jul 2018 13:42:17 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mzcZlgaJG1ki; Fri, 6 Jul 2018 13:42:11 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 3A7418F488B7; Fri, 6 Jul 2018 13:41:48 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:29 +0200 Message-Id: <1530884489-28089-13-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 12/12] board/BuR/brppt1: add makerule for generating production files X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Hannes Schmelzer --- board/BuR/brppt1/config.mk | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 board/BuR/brppt1/config.mk diff --git a/board/BuR/brppt1/config.mk b/board/BuR/brppt1/config.mk new file mode 100644 index 0000000..b11b544 --- /dev/null +++ b/board/BuR/brppt1/config.mk @@ -0,0 +1,36 @@ +# +# Copyright (C) 2018 Hannes Schmelzer - +# 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)