From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 27 Apr 2009 00:36:06 +0200 Subject: [U-Boot] [PATCH v3] Marvell MV88F6281GTW_GE Board support In-Reply-To: <73173D32E9439E4ABB5151606C3E19E201CA9AB599@SC-VEXCH1.marvell.com> References: <73173D32E9439E4ABB5151606C3E19E201C6B9BA43@SC-VEXCH1.marvell.com> <73173D32E9439E4ABB5151606C3E19E201CA9AB599@SC-VEXCH1.marvell.com> Message-ID: <20090426223606.GK32215@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 07:19 Thu 23 Apr , Prafulla Wadaskar wrote: > This is Marvell's 88F6281_A0 based custom board developed > for wireless access point product > > This patch is tested for- > 1. Boot from DRAM/SPI flash/NFS > 2. File transfer using tftp and loadb > 3. SPI flash read/write/erase > 4. Booting Linux kernel and RFS from SPI flash > > Reviewed-by: Ronen Shitrit > Signed-off-by: Prafulla Wadaskar > --- > Change log > v2: updated as per first review comments > debug_prints updated to debug > > v3: updated as per review comments for v2 > added mv88f6281gtw_ge.h file > removed BITxx macros first a general comment I do not known if it's your mailer but all tab are converted in whitespace please fix it > > MAKEALL | 1 + > Makefile | 3 + > board/Marvell/mv88f6281gtw_ge/Makefile | 51 +++++++ > board/Marvell/mv88f6281gtw_ge/config.mk | 25 ++++ > board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c | 102 +++++++++++++ > board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.h | 46 ++++++ > board/Marvell/mv88f6281gtw_ge/u-boot.lds | 53 +++++++ > include/configs/mv88f6281gtw_ge.h | 175 +++++++++++++++++++++++ > 8 files changed, 456 insertions(+), 0 deletions(-) > create mode 100644 board/Marvell/mv88f6281gtw_ge/Makefile > create mode 100644 board/Marvell/mv88f6281gtw_ge/config.mk > create mode 100644 board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c > create mode 100644 board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.h > create mode 100644 board/Marvell/mv88f6281gtw_ge/u-boot.lds > create mode 100644 include/configs/mv88f6281gtw_ge.h > > diff --git a/MAKEALL b/MAKEALL > index e4eb42b..1caf81d 100755 > --- a/MAKEALL > +++ b/MAKEALL > @@ -504,6 +504,7 @@ LIST_ARM9=" \ > cp946es \ > cp966 \ > lpd7a400 \ > + mv88f6281gtw_ge \ > mx1ads \ > mx1fs2 \ > netstar \ > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, > + * MA 02110-1301 USA > + */ > + > +#include > +#include <../drivers/net/phy/mv88e61xx.h> > +#include > +#include "mv88f6281gtw_ge.h" > + > +DECLARE_GLOBAL_DATA_PTR; > + > +int board_init(void) > +{ > + /* Board Parameters initializations */ could explain what you do a few more? > + kw_window_ctrl_reg_init(); > + kw_gpio_init(MV88F6281GTW_GE_OE_VAL_LOW, > + MV88F6281GTW_GE_OE_VAL_HIGH, > + MV88F6281GTW_GE_OE_LOW, MV88F6281GTW_GE_OE_HIGH); > + > + kw_mpp_control_init(MV88F6281GTW_GE_MPP0_7, > + MV88F6281GTW_GE_MPP8_15, > + MV88F6281GTW_GE_MPP16_23, > + MV88F6281GTW_GE_MPP24_31, > + MV88F6281GTW_GE_MPP32_39, > + MV88F6281GTW_GE_MPP40_47, MV88F6281GTW_GE_MPP48_55); > + from > + /* serial config */ > + gd->baudrate = CONFIG_BAUDRATE; > + gd->have_console = 1; no need please remove > + /* > + * arch number of USED SOC > + */ > + gd->bd->bi_arch_number = MACH_TYPE_MV88F6281GTW_GE; > + > + /* adress of boot parameters */ > + gd->bd->bi_boot_params = 0x00000100; please be more consistant with the other arm boards RAM_BASE + 0x100 > + > + return 0; > +} > + > +int dram_init(void) > +{ > + int i; > + > + for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { > + gd->bd->bi_dram[i].start = kw_sdram_bar(i); > + gd->bd->bi_dram[i].size = kw_sdram_bs(i); > + } > + return 0; > +} > + > +int last_stage_init(void) > +{ > + return 0; > +} no need please remove > + > +#if defined(CONFIG_MISC_INIT_R) > +/* miscellaneous platform dependent init */ > +int misc_init_r(void) > +{ > + return kw_misc_init_r(); > +} if it's really arch late init please create a generic function like arch_late_init or arch_misc_init and call it from lib_arm/board.c > + > +void reset_phy(void) > +{ > +#ifdef CONFIG_MV88E61XX_SWITCH > + /* configure and initialize switch */ > + struct mv88e61xx_config swcfg = { > + .name = "egiga0", > + .vlancfg = MV88E61XX_VLANCFG_ROUTER, > + .rgmii_delay = MV88E61XX_RGMII_DELAY_EN, > + .portstate = MV88E61XX_PORTSTT_FORWARDING, > + .cpuport = 5, > + .ports_enabled = (PORT(0) | PORT(1) | PORT(2) > + | PORT(3) | PORT(4) | PORT(5)) > + }; > + > + mv88e61xx_switch_initialize(&swcfg); > +#endif > +} please only call reset_phy when the SWITCH is enable. it will reduce the size of u-boot whenyou do not use the switch > + > +#endif /* CONFIG_MISC_INIT_R */ > diff --git a/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.h b/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.h > new file mode 100644 > index 0000000..6e91c25 > --- /dev/null > +++ b/board/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.h > @@ -0,0 +1,46 @@ > +/* > + * (C) Copyright 2009 > + * Marvell Semiconductor > + * Prafulla Wadaskar > + * > + * See file CREDITS for list of people who contributed to this > + * project. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, > + * MA 02110-1301 USA > + */ > + > +#ifndef __MV88F6281GTW_GE_H > +#define __MV88F6281GTW_GE_H > + > +#define MV88F6281GTW_GE_OE_LOW (~((1<<7) | (1<<20) \ > + |(1<<21))) /*enable GLED,RLED */ > +#define MV88F6281GTW_GE_OE_HIGH (~((1<<4)|(1<<6)|(1<<7)|(1<<12) \ > + |(1<<13)|(1<<16)|(1<<17))) > +#define MV88F6281GTW_GE_OE_VAL_LOW (1<<20) /*make GLED on */ > +#define MV88F6281GTW_GE_OE_VAL_HIGH ((1<<6)|(1<<13)|(1<<16)|(1<<17)) > + > +/* > + * Default values for MPP registers > + */ > +#define MV88F6281GTW_GE_MPP0_7 0x01112222 > +#define MV88F6281GTW_GE_MPP8_15 0x11103311 > +#define MV88F6281GTW_GE_MPP16_23 0x00001111 > +#define MV88F6281GTW_GE_MPP24_31 0x22222222 > +#define MV88F6281GTW_GE_MPP32_39 0x40440222 > +#define MV88F6281GTW_GE_MPP40_47 0x00004444 > +#define MV88F6281GTW_GE_MPP48_55 0x00000000 could explain a few more these value > + > +#endif /* __MV88F6281GTW_GE_H */ > diff --git a/board/Marvell/mv88f6281gtw_ge/u-boot.lds b/board/Marvell/mv88f6281gtw_ge/u-boot.lds > new file mode 100644 > index 0000000..9695f3f > --- /dev/null > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, > + * MA 02110-1301 USA > + */ > + > +#ifndef _CONFIG_MV88F6281GTW_GE_H > +#define _CONFIG_MV88F6281GTW_GE_H > + > +/* > + * Version number information > + */ > +#define CONFIG_IDENT_STRING "\nMarvell-MV88F6281GTW_GE-A0" > + > +/* > + * High Level Configuration Options (easy to change) > + */ > +#define CONFIG_MARVELL 1 > +#define CONFIG_ARM926EJS 1 /* Basic Architecture */ > +#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ > +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ > +#define CONFIG_KW88F6281 1 /* SOC Name */ > + > +#ifdef CONFIG_KIRKWOOD > +#define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */ > +#define CONFIG_ARCH_LOWLEVEL_INIT /* enable arch_lowlevel_init */ > +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ > +#define CONFIG_KIRKWOOD_EGIGA_INIT /* Enable GbePort0/1 for kernel */ > +#define CONFIG_KIRKWOOD_PCIE_INIT /* Enable PCIE Port0 for kernel */ > +#define CONFIG_KIRKWOOD_RGMII_PAD_1V8 /* Set RGMII Pad voltage to 1.8V */ > +#endif why? this boards is not a KIRWOOD? > + > +/* > + * CLKs configurations > + */ > +#define CONFIG_SYS_HZ 1000 > + > +/* > + * Serial Port configuration > + * The following definitions let you select what serial you want to use > + * for your console driver. > + */ > + * Default environment variables > + */ > +#define CONFIG_BOOTCOMMAND "$(x_bootcmd_kernel); setenv bootargs " \ IIRC please use ${} instead of $() > + "$(x_bootargs) $(x_bootargs_root); bootm 0x6400000;" > +#define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console=ttyS0,115200 " \ > + "mtdparts=spi0.0:512k(uboot),512k at 512k(psm),2m at 1m(kernel),13m at 3m(rootfs)\0" \ he could be usefull to use CONFIG_MTDPARTS > + "x_bootcmd_kernel=cp.b 0xf8100000 0x6400000 0x200000\0" \ > + "x_bootargs_root=root=/dev/mtdblock3 ro rootfstype=squashfs\0" > + Best Regards, J.