From patchwork Wed Apr 8 05:38:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 459093 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 79CB414012C for ; Wed, 8 Apr 2015 15:39:10 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4EA70A743F; Wed, 8 Apr 2015 07:39:04 +0200 (CEST) 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 PRwEDhaNXAQz; Wed, 8 Apr 2015 07:39:04 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C3E70A7440; Wed, 8 Apr 2015 07:38:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8B792A741C for ; Wed, 8 Apr 2015 07:38:53 +0200 (CEST) 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 eJbtnM13wZMb for ; Wed, 8 Apr 2015 07:38:53 +0200 (CEST) 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 s15287728.onlinehome-server.info (unknown [87.106.47.214]) by theia.denx.de (Postfix) with ESMTP id 57842A7420 for ; Wed, 8 Apr 2015 07:38:50 +0200 (CEST) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by s15287728.onlinehome-server.info (Postfix) with ESMTP id D550A8F480C5; Wed, 8 Apr 2015 05:38:49 +0000 (UTC) Received: from s15287728.onlinehome-server.info ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GOuGNEKusqQF; Wed, 8 Apr 2015 05:38:44 +0000 (UTC) Received: from hannes-werkstatt.scm.lan (62-46-211-204.adsl.highway.telekom.at [62.46.211.204]) by s15287728.onlinehome-server.info (Postfix) with ESMTP id 15D628F480C7; Wed, 8 Apr 2015 05:38:44 +0000 (UTC) From: Hannes Petermaier To: u-boot@lists.denx.de Date: Wed, 8 Apr 2015 07:38:34 +0200 Message-Id: <1428471515-3964-2-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1428471515-3964-1-git-send-email-oe5hpm@oevsv.at> References: <1428471515-3964-1-git-send-email-oe5hpm@oevsv.at> Cc: Tom Rini , Pantelis Antoniou Subject: [U-Boot] [PATCH 2/3] board/BuR/tseries: reactivate NAND-board 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The NAND-version has been become a bit orphan. Now we need to reactivate it, so bring necessary things: - loading devicetree - switch control signal to correct pins - setup pinmux - default-environment up to date. Signed-off-by: Hannes Petermaier --- board/BuR/common/common.c | 15 +++++++++++---- board/BuR/tseries/board.c | 3 +++ board/BuR/tseries/mux.c | 2 +- include/configs/tseries.h | 37 ++++++++++++++++++++----------------- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 81ed8e5..87e4fd6 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -33,6 +33,7 @@ #endif #include "bur_common.h" #include "../../../drivers/video/am335x-fb.h" +#include static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; @@ -159,17 +160,22 @@ int load_lcdtiming(struct am335x_lcdpanel *panel) #ifdef CONFIG_USE_FDT static int load_devicetree(void) { - char *dtbname = getenv("dtb"); - char *dtbdev = getenv("dtbdev"); - char *dtppart = getenv("dtbpart"); - u32 dtbaddr = getenv_ulong("dtbaddr", 16, 0UL); int rc; loff_t dtbsize; + u32 dtbaddr = getenv_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(&nand_info[0], 0x40000, (size_t *)&dtbsize, + NULL, 0x20000, (u_char *)dtbaddr); +#else + char *dtbname = getenv("dtb"); + char *dtbdev = getenv("dtbdev"); + char *dtppart = getenv("dtbpart"); if (!dtbdev || !dtbdev || !dtbname) { printf("%s: // missing.\n", __func__); return -1; @@ -180,6 +186,7 @@ static int load_devicetree(void) return -1; } rc = fs_read(dtbname, (u32)dtbaddr, 0, 0, &dtbsize); +#endif if (rc == 0) { gd->fdt_blob = (void *)dtbaddr; gd->fdt_size = dtbsize; diff --git a/board/BuR/tseries/board.c b/board/BuR/tseries/board.c index 89e989f..d1d698e 100644 --- a/board/BuR/tseries/board.c +++ b/board/BuR/tseries/board.c @@ -128,6 +128,9 @@ void am33xx_spl_board_init(void) i2c_set_bus_num(0); 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 */ } const struct dpll_params *get_dpll_ddr_params(void) diff --git a/board/BuR/tseries/mux.c b/board/BuR/tseries/mux.c index ac7e885..caedf00 100644 --- a/board/BuR/tseries/mux.c +++ b/board/BuR/tseries/mux.c @@ -123,7 +123,7 @@ static struct module_pin_mux nand_pin_mux[] = { {OFFSET(gpmc_ad5), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* NAND AD5 */ {OFFSET(gpmc_ad6), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* NAND AD6 */ {OFFSET(gpmc_ad7), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* NAND AD7 */ - {OFFSET(gpmc_wait0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* NAND WAIT */ + {OFFSET(gpmc_clk), (MODE(2) | RXACTIVE | PULLUP_EN)}, /* NAND WAIT */ {OFFSET(gpmc_wpn), (MODE(7) | PULLUP_EN | RXACTIVE)}, /* NAND_WPN */ {OFFSET(gpmc_csn0), (MODE(0) | PULLUDEN)}, /* NAND_CS0 */ {OFFSET(gpmc_advn_ale), (MODE(0) | PULLUDEN)}, /* NAND_ADV_ALE */ diff --git a/include/configs/tseries.h b/include/configs/tseries.h index a6c7d5f..1e41a12 100644 --- a/include/configs/tseries.h +++ b/include/configs/tseries.h @@ -23,6 +23,8 @@ #define CONFIG_HW_WATCHDOG #define CONFIG_OMAP_WATCHDOG #define CONFIG_SPL_WATCHDOG_SUPPORT + +#define CONFIG_SPL_GPIO_SUPPORT /* Bootcount using the RTC block */ #define CONFIG_SYS_BOOTCOUNT_ADDR 0x44E3E000 #define CONFIG_BOOTCOUNT_LIMIT @@ -103,15 +105,16 @@ "mtdparts=" MTDPARTS_DEFAULT "\0" \ "nandargs=setenv bootargs console=${console} " \ "${optargs} " \ - "root=${nandroot} " \ - "rootfstype=${nandrootfstype}\0" \ - "nandroot=ubi0:rootfs rw ubi.mtd=8,2048\0" \ - "nandrootfstype=ubifs rootwait=1\0" \ - "nandimgsize=0x500000\0" \ - "nandboot=echo Booting from nand ...; " \ + "root=mtd6 " \ + "rootfstype=jffs2\0" \ + "kernelsize=0x400000\0" \ + "nandboot=echo booting from nand ...; " \ "run nandargs; " \ - "nand read ${loadaddr} kernel ${nandimgsize}; " \ - "bootz ${loadaddr}\0" + "nand read ${loadaddr} kernel ${kernelsize}; " \ + "bootz ${loadaddr} - ${dtbaddr}\0" \ + "defboot=run nandboot\0" \ + "bootlimit=1\0" \ + "altbootcmd=run usbscript\0" #else #define NANDARGS "" #endif /* CONFIG_NAND */ @@ -231,15 +234,15 @@ MMCARGS #define MTDIDS_DEFAULT "nand0=omap2-nand.0" #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:" \ - "128k(SPL)," \ - "128k(SPL.backup1)," \ - "128k(SPL.backup2)," \ - "128k(SPL.backup3)," \ - "512k(u-boot)," \ - "128k(u-boot-spl-os)," \ + "128k(MLO)," \ + "128k(MLO.backup)," \ + "128k(dtb)," \ "128k(u-boot-env)," \ - "5m(kernel),"\ - "-(rootfs)" + "512k(u-boot)," \ + "4m(kernel),"\ + "128m(rootfs),"\ + "-(user)" +#define CONFIG_NAND_OMAP_GPMC_WSCFG 1 #endif /* CONFIG_NAND */ /* USB configuration */ @@ -298,7 +301,7 @@ MMCARGS #else #define CONFIG_ENV_IS_IN_NAND #endif -#define CONFIG_ENV_OFFSET 0x120000 /* TODO: Adresse definieren */ +#define CONFIG_ENV_OFFSET 0x60000 #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_ENV_SIZE #else #error "no storage for Environment defined!"