From patchwork Tue Nov 10 00:15:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 56274 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp473110lbb; Mon, 9 Nov 2015 16:16:25 -0800 (PST) X-Received: by 10.194.95.65 with SMTP id di1mr705740wjb.134.1447114585845; Mon, 09 Nov 2015 16:16:25 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id fy19si765265wjc.142.2015.11.09.16.16.25; Mon, 09 Nov 2015 16:16:25 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E2A394B905; Tue, 10 Nov 2015 01:16:24 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ec5z9ZoLaUWd; Tue, 10 Nov 2015 01:16:24 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F67B4B901; Tue, 10 Nov 2015 01:16:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EF05B4B901 for ; Tue, 10 Nov 2015 01:16:16 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QL-2si5wrjj8 for ; Tue, 10 Nov 2015 01:16:16 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by theia.denx.de (Postfix) with ESMTPS id C54454B900 for ; Tue, 10 Nov 2015 01:16:11 +0100 (CET) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id tAA0FFhN016923; Mon, 9 Nov 2015 18:15:15 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAA0FFPu017029; Mon, 9 Nov 2015 18:15:15 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Mon, 9 Nov 2015 18:15:15 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAA0FF0P016644; Mon, 9 Nov 2015 18:15:15 -0600 Date: Mon, 9 Nov 2015 18:15:15 -0600 From: Nishanth Menon To: Steve Kipisz Message-ID: <20151110001515.GA2195@kahuna> References: <1446770376-8205-1-git-send-email-s-kipisz2@ti.com> <1446770376-8205-7-git-send-email-s-kipisz2@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1446770376-8205-7-git-send-email-s-kipisz2@ti.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: trini@konsulko.com, beagleboard-x15@googlegroups.com, u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH v4 7/7] board: ti: AM57xx: Add detection logic for AM57xx-evm X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" On 18:39-20151105, Steve Kipisz wrote: [...] > diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c > index 042f9ab1965a..15da8e66fee5 100644 > --- a/board/ti/am57xx/board.c > +++ b/board/ti/am57xx/board.c [...] > +static void setup_board_eeprom_env(void) > +{ > + char *name = "beagle_x15"; > + int rc; > + struct ti_am_eeprom_printable p; > + > + rc = ti_i2c_eeprom_am_get_print(CONFIG_EEPROM_BUS_ADDRESS, > + CONFIG_EEPROM_CHIP_ADDRESS, &p); > + if (rc) { > + printf("Invalid EEPROM data(@0x%p). Default to X15\n", > + TI_AM_EEPROM_DATA); > + goto invalid_eeprom; > + } > + > + if (board_is_am572x_evm()) > + name = "am57xx_evm"; I suggest adding: else if (board_is_x15()) name = "beagle_x15"; If we dont do that, we end up with the "Unidentified board claim" print even if we have a valid eeprom. Also, at this point, we can reasonably detect and update our prints (to prevent folks from being confused :)) How about squashing the following to this patch? -- Regards, Nishanth Menon _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 4ae484140608..30d358885fe0 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -46,7 +46,7 @@ DECLARE_GLOBAL_DATA_PTR; #define GPIO_DDR_VTT_EN 203 const struct omap_sysinfo sysinfo = { - "Board: BeagleBoard x15\n" + "Board: UNKNOWN(BeagleBoard X15?)\n" }; static const struct dmm_lisa_map_regs beagle_x15_lisa_regs = { @@ -262,6 +262,27 @@ void do_board_detect(void) #else /* CONFIG_SPL_BUILD */ +void do_board_detect(void) +{ + struct ti_am_eeprom *ep; + char *bname = NULL; + int rc; + + rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS, + CONFIG_EEPROM_CHIP_ADDRESS, &ep); + if (rc) + printf("ti_i2c_eeprom_init failed %d\n", rc); + + if (board_is_x15()) + bname = "BeagleBoard X15"; + else if (board_is_am572x_evm()) + bname = "AM572x EVM"; + + if (bname) + snprintf(sysinfo.board_string, sizeof(sysinfo.board_string), + "Board: %s\n", bname); +} + static void setup_board_eeprom_env(void) { char *name = "beagle_x15";