[U-Boot] [PATCH 0/1 v4] RFC: Dreamplug support

From: Jason Cooper u-boot@lakedaemon.net
It compiles clean, and I've loaded it via JTAG and used it to dump the existing bootloader out of the SPI flash. I have _not_ used it to burn itself to the flash yet. I'm looking for comments before I try that. ;-)
Some concerns:
- The SPI flash chip is a Macronix MX25L1606, however it has the identical chip idcode to the MX25L1605. How is that properly handled? The 06 does have some new features [1].
[1] http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Inde...
Changes from v1 to v2:
- resorted series to move 'make all' support last.
Changes from v2 to v3:
- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux. - Update MAINTAINERS. - Collapse into one patch.
Changes from v3 to v4:
- update copyright info as recommended by Prafulla Wadaskar. - maintain proper order in boards.cfg, MAINTAINERS, etc. - label MPP's - change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).
Jason Cooper (1): dreamplug: Initial support.
MAINTAINERS | 4 + MAKEALL | 1 + board/Marvell/dreamplug/Makefile | 54 +++++++++++ board/Marvell/dreamplug/dreamplug.c | 157 ++++++++++++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 ++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 114 ++++++++++++++++++++++++ 8 files changed, 536 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h

From: Jason Cooper u-boot@lakedaemon.net
Copied files from boards/Marvell/guruplug/ and did s/GURUPLUG/DREAMPLUG/g s/guruplug/dreamplug/g
Switched from NAND flash to SPI flash. MPP._SPI_ configuration copied from boards/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c
Also, MACH_TYPE_DREAMPLUG (board id 3550) has been registered at http://www.arm.linux.co.uk/developer/machines/.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net --- MAINTAINERS | 4 + MAKEALL | 1 + board/Marvell/dreamplug/Makefile | 54 +++++++++++ board/Marvell/dreamplug/dreamplug.c | 157 ++++++++++++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 ++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 114 ++++++++++++++++++++++++ 8 files changed, 536 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
diff --git a/MAINTAINERS b/MAINTAINERS index c462ae2..9422c7e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,10 @@ Conn Clark clark@esteem.com
ESTEEM192E MPC8xx
+Jason Cooper u-boot@lakedaemon.net + + dreamplug ARM926EJS (Kirkwood SoC) + Joe D'Abbraccio ljd015@freescale.com
MPC837xERDB MPC837x diff --git a/MAKEALL b/MAKEALL index d592374..b17b46d 100755 --- a/MAKEALL +++ b/MAKEALL @@ -335,6 +335,7 @@ LIST_ARM9=" \ cp966 \ da830evm \ da850evm \ + dreamplug \ edb9301 \ edb9302 \ edb9302a \ diff --git a/board/Marvell/dreamplug/Makefile b/board/Marvell/dreamplug/Makefile new file mode 100644 index 0000000..9ee5406 --- /dev/null +++ b/board/Marvell/dreamplug/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := dreamplug.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..48aeba0 --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c @@ -0,0 +1,157 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 + */ + +#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "dreamplug.h" + +DECLARE_GLOBAL_DATA_PTR; + +int board_early_init_f(void) +{ + /* + * default gpio configuration + * There are maximum 64 gpios controlled through 2 sets of registers + * the below configuration configures mainly initial LED status + */ + kw_config_gpio(DREAMPLUG_OE_VAL_LOW, + DREAMPLUG_OE_VAL_HIGH, + DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH); + + /* Multi-Purpose Pins Functionality configuration */ + u32 kwmpp_config[] = { + MPP0_SPI_SCn, /* SPI Flash */ + MPP1_SPI_MOSI, + MPP2_SPI_SCK, + MPP3_SPI_MISO, + MPP4_GPIO, + MPP5_GPO, + MPP6_SYSRST_OUTn, + MPP7_GP0, + MPP8_TW_SDA, + MPP9_TW_SCK, + MPP10_UART0_TXD, /* Serial */ + MPP11_UART0_RXD, + MPP12_SD_CLK, /* SDIO Slot */ + MPP13_SD_CMD, + MPP14_SD_D0, + MPP15_SD_D1, + MPP16_SD_D2, + MPP17_SD_D3, + MPP18_GPO, + MPP19_GPO, + MPP20_GE1_0, /* Gigabit Ethernet */ + MPP21_GE1_1, + MPP22_GE1_2, + MPP23_GE1_3, + MPP24_GE1_4, + MPP25_GE1_5, + MPP26_GE1_6, + MPP27_GE1_7, + MPP28_GE1_8, + MPP29_GE1_9, + MPP30_GE1_10, + MPP31_GE1_11, + MPP32_GE1_12, + MPP33_GE1_13, + MPP34_GE1_14, + MPP35_GE1_15, + MPP36_GPIO, + MPP37_GPIO, + MPP38_GPIO, + MPP39_GPIO, + MPP40_TDM_SPI_SCK, + MPP41_TDM_SPI_MISO, + MPP42_TDM_SPI_MOSI, + MPP43_GPIO, + MPP44_GPIO, + MPP45_GPIO, + MPP46_GPIO, /* M_RLED */ + MPP47_GPIO, /* M_GLED */ + MPP48_GPIO, /* B_RLED */ + MPP49_GPIO, /* B_GLED */ + 0 + }; + kirkwood_mpp_conf(kwmpp_config); + return 0; +} + +int board_init(void) +{ + /* + * arch number of board + * XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline. + */ + gd->bd->bi_arch_number = MACH_TYPE_DREAMPLUG; + + /* adress of boot parameters */ + gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; + + return 0; +} + +#ifdef CONFIG_RESET_PHY_R +void mv_phy_88e1121_init(char *name) +{ + u16 reg; + u16 devadr; + + if (miiphy_set_current_dev(name)) + return; + + /* command to read PHY dev address */ + if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { + printf("Err..%s could not read PHY dev address\n", + __FUNCTION__); + return; + } + + /* + * Enable RGMII delay on Tx and Rx for CPU port + * Ref: sec 4.7.2 of chip datasheet + */ + miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2); + miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, ®); + reg |= (MV88E1121_RGMII_RXTM_CTRL | MV88E1121_RGMII_TXTM_CTRL); + miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg); + miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0); + + /* reset the phy */ + miiphy_reset(name, devadr); + + printf("88E1121 Initialized on %s\n", name); +} + +void reset_phy(void) +{ + /* configure and initialize both PHY's */ + mv_phy_88e1121_init("egiga0"); + mv_phy_88e1121_init("egiga1"); +} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h new file mode 100644 index 0000000..21bf644 --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.h @@ -0,0 +1,42 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 __DREAMPLUG_H +#define __DREAMPLUG_H + +#define DREAMPLUG_OE_LOW (~(0)) +#define DREAMPLUG_OE_HIGH (~(0)) +#define DREAMPLUG_OE_VAL_LOW 0 +#define DREAMPLUG_OE_VAL_HIGH (0xf << 16) /* 4 LED Pins high */ + +/* PHY related */ +#define MV88E1121_MAC_CTRL2_REG 21 +#define MV88E1121_PGADR_REG 22 +#define MV88E1121_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1121_RGMII_RXTM_CTRL (1 << 5) + +#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg new file mode 100644 index 0000000..ca9cd74 --- /dev/null +++ b/board/Marvell/dreamplug/kwbimage.cfg @@ -0,0 +1,163 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM spi + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0/1 interface pad voltage to 1.8V +DATA 0xFFD100e0 0x1b1b9b9b + +#Dram initalization for SINGLE x16 CL=5 @ 400MHz +DATA 0xFFD01400 0x43000c30 # DDR Configuration register +# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01 + +DATA 0xFFD01404 0x37543000 # DDR Controller Control Low +# bit 4: 0=addr/cmd in smame cycle +# bit 5: 0=clk is driven during self refresh, we don't care for APX +# bit 6: 0=use recommended falling edge of clk for addr/cmd +# bit14: 0=input buffer always powered up +# bit18: 1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31: 0=no additional STARTBURST delay + +DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) +# bit3-0: TRAS lsbs +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20: TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP + +DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required + +DATA 0xFFD01410 0x000000cc # DDR Address Control +# bit1-0: 01, Cs0width=x8 +# bit3-2: 10, Cs0size=1Gb +# bit5-4: 01, Cs1width=x8 +# bit7-6: 10, Cs1size=1Gb +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16: 0, Cs0AddrSel +# bit17: 0, Cs1AddrSel +# bit18: 0, Cs2AddrSel +# bit19: 0, Cs3AddrSel +# bit31-20: 0 required + +DATA 0xFFD01414 0x00000000 # DDR Open Pages Control +# bit0: 0, OpenPage enabled +# bit31-1: 0 required + +DATA 0xFFD01418 0x00000000 # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required + +DATA 0xFFD0141C 0x00000C52 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery ???????????? +# bit12: 0, PD must be zero +# bit31-13: 0 required + +DATA 0xFFD01420 0x00000040 # DDR Extended Mode +# bit0: 0, DDR DLL enabled +# bit1: 0, DDR drive strenght normal +# bit2: 0, DDR ODT control lsd (disabled) +# bit5-3: 000, required +# bit6: 1, DDR ODT control msb, (disabled) +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required + +DATA 0xFFD01424 0x0000F17F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 0 +# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz +# bit9 : 0 , no half clock cycle addition to dataout +# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals +# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh +# bit15-12: 1111 required +# bit31-16: 0 required + +DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) +DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) + +DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 +DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size +# bit0: 1, Window enabled +# bit1: 0, Write Protect disabled +# bit3-2: 00, CS0 hit selected +# bit23-4: ones, required +# bit31-24: 0x0F, Size (i.e. 256MB) + +DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb +DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 + +DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled +DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled + +DATA 0xFFD01494 0x00030000 # DDR ODT Control (Low) +DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) +# bit1-0: 00, ODT0 controlled by ODT Control (low) register above +# bit3-2: 01, ODT1 active NEVER! +# bit31-4: zero, required + +DATA 0xFFD0149C 0x0000E803 # CPU ODT Control +DATA 0xFFD01480 0x00000001 # DDR Initialization Control +#bit0=1, enable DDR init upon this register write + +# End of Header extension +DATA 0x0 0x0 diff --git a/boards.cfg b/boards.cfg index d2cacc8..f42aba0 100644 --- a/boards.cfg +++ b/boards.cfg @@ -109,6 +109,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood suen8 arm arm926ejs km_arm keymile kirkwood mgcoge3un arm arm926ejs km_arm keymile kirkwood +dreamplug arm arm926ejs - Marvell kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..6aceed9 --- /dev/null +++ b/include/configs/dreamplug.h @@ -0,0 +1,114 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 _CONFIG_DREAMPLUG_H +#define _CONFIG_DREAMPLUG_H + +/* + * Version number information + */ +#define CONFIG_IDENT_STRING "\nMarvell-DreamPlug" + +/* + * High Level Configuration Options (easy to change) + */ +#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_DREAMPLUG /* Machine type */ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* + * Commands configuration + */ +#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#include <config_cmd_default.h> +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ENV +#define CONFIG_CMD_FAT +#define CONFIG_CMD_SF +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_CMD_IDE + +/* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros + */ +#include "mv-common.h" + +/* + * Environment variables configurations + */ +#ifdef CONFIG_CMD_NAND +#define CONFIG_ENV_IS_IN_NAND 1 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif +/* + * max 4k env size is enough, but in case of nand + * it has to be rounded to sector size + */ +#define CONFIG_ENV_SIZE 0x20000 /* 128k */ +#define CONFIG_ENV_ADDR 0x60000 +#define CONFIG_ENV_OFFSET 0x60000 /* env starts here */ + +/* + * Default environment variables + */ +#define CONFIG_BOOTCOMMAND "setenv ethact egiga0; " \ + "${x_bootcmd_ethernet}; setenv ethact egiga1; " \ + "${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; "\ + "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ + "bootm 0x6400000;" + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "x_bootcmd_ethernet=ping 192.168.2.1\0" \ + "x_bootcmd_usb=usb start\0" \ + "x_bootcmd_kernel=nand read.e 0x6400000 0x100000 0x400000\0" \ + "x_bootargs=console=ttyS0,115200\0" \ + "x_bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs\0" + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +#define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +#define CONFIG_PHY_BASE_ADR 0 +#endif /* CONFIG_CMD_NET */ + +/* + * SATA Driver configuration + */ +#ifdef CONFIG_MVSATA_IDE +#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET +#endif /*CONFIG_MVSATA_IDE*/ + +#define CONFIG_SYS_ALT_MEMTEST + +#endif /* _CONFIG_DREAMPLUG_H */

-----Original Message----- From: u-boot@lakedaemon.net [mailto:u-boot@lakedaemon.net] Sent: Monday, June 13, 2011 9:24 PM To: u-boot@lists.denx.de Cc: Prafulla Wadaskar; Siddarth Gore; Jason Cooper Subject: [PATCH 1/1 v4] RFC: dreamplug: Initial support.
From: Jason Cooper u-boot@lakedaemon.net
Copied files from boards/Marvell/guruplug/ and did s/GURUPLUG/DREAMPLUG/g s/guruplug/dreamplug/g
Switched from NAND flash to SPI flash. MPP._SPI_ configuration copied from boards/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c
Also, MACH_TYPE_DREAMPLUG (board id 3550) has been registered at http://www.arm.linux.co.uk/developer/machines/.
Since you have only one patch in the series you can avoid 0/1 for your next posts.
I will post review comments latter
Regards.. Prafulla . .

On Mon, Jun 13, 2011 at 08:59:30AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: u-boot@lakedaemon.net [mailto:u-boot@lakedaemon.net] Sent: Monday, June 13, 2011 9:24 PM To: u-boot@lists.denx.de Cc: Prafulla Wadaskar; Siddarth Gore; Jason Cooper Subject: [PATCH 1/1 v4] RFC: dreamplug: Initial support.
From: Jason Cooper u-boot@lakedaemon.net
Copied files from boards/Marvell/guruplug/ and did s/GURUPLUG/DREAMPLUG/g s/guruplug/dreamplug/g
Switched from NAND flash to SPI flash. MPP._SPI_ configuration copied from boards/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c
Also, MACH_TYPE_DREAMPLUG (board id 3550) has been registered at http://www.arm.linux.co.uk/developer/machines/.
Since you have only one patch in the series you can avoid 0/1 for your next posts.
Ok, I was just trying to keep submission comments separate from commit messages. Is there a better way to do that?
I will post review comments latter
Thanks,
Jason

Dear Jason,
In message 20110613160721.GN9516@titan.lakedaemon.net you wrote:
Ok, I was just trying to keep submission comments separate from commit messages. Is there a better way to do that?
Please add them to the comment section, i. e. below the "---" line. This is MUCH better, because then they also show up in patchwork, which is not the case with a separate cover letter message.
Best regards,
Wolfgang Denk

On Mon, Jun 13, 2011 at 06:46:19PM +0200, Wolfgang Denk wrote:
Dear Jason,
In message 20110613160721.GN9516@titan.lakedaemon.net you wrote:
Ok, I was just trying to keep submission comments separate from commit messages. Is there a better way to do that?
Please add them to the comment section, i. e. below the "---" line. This is MUCH better, because then they also show up in patchwork, which is not the case with a separate cover letter message.
Ahhh, thanks for the clarification. I'll make sure to do that if there needs to be another revision, or once Linux support is mainlined and I'm submitting for inclusion.
thx,
Jason.

On Mon, Jun 13, 2011 at 12:51:30PM -0400, Jason wrote:
Ahhh, thanks for the clarification. I'll make sure to do that if there needs to be another revision, or once Linux support is mainlined and I'm submitting for inclusion.
What's the current state of this?
Thanks.

On Thu, Jul 21, 2011 at 07:36:07PM +0000, Clint Adams wrote:
On Mon, Jun 13, 2011 at 12:51:30PM -0400, Jason wrote:
Ahhh, thanks for the clarification. I'll make sure to do that if there needs to be another revision, or once Linux support is mainlined and I'm submitting for inclusion.
What's the current state of this?
Dead. GlobalScale/Marvell refuse to release the u-boot source code, and the ARM maintainers of Linux aren't accepting new board code until they unfsck their tree.
So the chance of doing it properly (new board id, proper MPP config, etc) is slim to none.
The kernel shipped with the Dreamplug is apparently the exact same one as in the Guruplug. The Dreamplug u-boot even uses the guruplug board-id, despite having a totally different flash chip on a different bus. The Dreamplug/Guruplug kernel has absolutely no support for the SPI flash chip compiled in. Despite the fact that the driver is already in mainline...
I've had it working, but suffering random oopses and crashes. I believe this is due to me guessing at the MPP config (based on other Marvell boards with same processor / flash chip). But I'm shooting in the dark unless I see the source code to u-boot.
It's a shame, because they finally solved the overheating issues.
hth,
Jason.

On Thu, Jul 21, 2011 at 04:26:29PM -0400, Jason wrote:
I've had it working, but suffering random oopses and crashes. I believe this is due to me guessing at the MPP config (based on other Marvell boards with same processor / flash chip). But I'm shooting in the dark unless I see the source code to u-boot.
This is from Globalscale. It's a git clone of u-boot-marvell from 2010, with a dirty working tree (patching the guruplug target to be a dreamplug).
http://people.debian.org/~clint/dreamplug/dreamplug-uboot-gti.tar.gz
I hope this helps.

On Thu, Jul 21, 2011 at 08:56:25PM +0000, Clint Adams wrote:
On Thu, Jul 21, 2011 at 04:26:29PM -0400, Jason wrote:
I've had it working, but suffering random oopses and crashes. I believe this is due to me guessing at the MPP config (based on other Marvell boards with same processor / flash chip). But I'm shooting in the dark unless I see the source code to u-boot.
This is from Globalscale. It's a git clone of u-boot-marvell from 2010, with a dirty working tree (patching the guruplug target to be a dreamplug).
http://people.debian.org/~clint/dreamplug/dreamplug-uboot-gti.tar.gz
I hope this helps.
Awesome! Thanks! I didn't even know about the rtc driver. iirc, most of the kernel oopses involved rtc stuff. I'll take a more detailed look later, have to fix the file permissions first. They must've had it on a windows system. Everything is executable. :-(
$ for fn in `git diff --name-only`; do chmod -x "$fn"; done
fixed it right up. I'll import this into my tree and see if I can get a running system.
Thanks again,
Jason.

All,
This is a complete redo from v4. I received a copy of the u-boot source code GlobalScale used in the Dreamplug. This series is a mix of my code and theirs.
Patches 1 and 2 add features to boards using the kirkwood arch. I think. I have no way to test it on guruplug/sheevaplug/etc. They work on dreamplug, though.
Patch 3 increases the timeout for slow-to-respond EHCI chips, like that found in the dreamplug. It may help other places. If it's non-harmful, it can also be applied separately.
Patch 4 adds the dreamplug support. It uses the spi flash, boots from it, writes the environment to it, etc. It also enables and uses patches 1 and 2.
Patch 5 is for once the dreamplug machid and board support are added to the mailine Linux kernel.
Jason Cooper (5): drivers/rtc: add Marvell Integrated RTC. arm/kirkwood: print speeds with cpu info. usb: Some EHCI chipsets are slow to respond. dreamplug: initial board support. dreamplug: use MACH_TYPE_DREAMPLUG
MAINTAINERS | 4 + MAKEALL | 1 + arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 46 +++++++++ arch/arm/include/asm/arch-kirkwood/cpu.h | 1 + board/Marvell/dreamplug/Makefile | 54 ++++++++++ board/Marvell/dreamplug/dreamplug.c | 154 ++++++++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 ++++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 ++++++++++++++++++++++++++++++ boards.cfg | 1 + drivers/rtc/Makefile | 1 + drivers/rtc/mvinteg_rtc.c | 151 +++++++++++++++++++++++++++ drivers/rtc/mvinteg_rtc.h | 89 ++++++++++++++++ include/configs/dreamplug.h | 138 +++++++++++++++++++++++++ include/usb.h | 2 +- 14 files changed, 846 insertions(+), 1 deletions(-) create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 drivers/rtc/mvinteg_rtc.c create mode 100644 drivers/rtc/mvinteg_rtc.h create mode 100644 include/configs/dreamplug.h

From: Jason Cooper u-boot@lakedaemon.net
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net --- Changes from v1 to v2:
- resorted series to move 'make all' support last.
Changes from v2 to v3:
- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux. - Update MAINTAINERS. - Collapse into one patch.
Changes from v3 to v4:
- update copyright info as recommended by Prafulla Wadaskar. - maintain proper order in boards.cfg, MAINTAINERS, etc. - label MPP's - change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).
Changes from v4 to v5:
- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech. - Added driver for integrated RTC. (thx GST!) - Added support for displaying CPU frequencies at boot. (thx GST!) - Adjust USB timeout to handle dreamplug EHCI chipset. - Cleaned up MPP registers based on Global Scale code. (thx GST!) - broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to use MACH_TYPE_DREAMPLUG.
Changes from v5 to v6:
- Define MACH_TYPE_DREAMPLUG in includes/configs/dreamplug.h until Linus's kernel.org tree includes assigned machine id. This is on Wolfgang's recommendation [1]. - Removed dcache disabling as it is no longer enabled by default. - USB timeout fix was merged. - Marvell Integrated RTC was merged. - Dropped CPU frequency printout as I'm not familiar enough with all flavors of kirkwood SoCs to do it correctly. - Labelled MPP*_GPIO pins that are broken out as gpio pins for the user. - Fixed function name mv_phy_88e1121_init() -> mv_phy_88e1116_init().
[1] http://www.mail-archive.com/u-boot@lists.denx.de/msg60921.html
MAINTAINERS | 4 + board/Marvell/dreamplug/Makefile | 54 +++++++++++ board/Marvell/dreamplug/dreamplug.c | 154 ++++++++++++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 ++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 158 ++++++++++++++++++++++++++++++++ 7 files changed, 576 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
diff --git a/MAINTAINERS b/MAINTAINERS index 2f60a60..88d5637 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,10 @@ Conn Clark clark@esteem.com
ESTEEM192E MPC8xx
+Jason Cooper u-boot@lakedaemon.net + + dreamplug ARM926EJS (Kirkwood SoC) + Joe D'Abbraccio ljd015@freescale.com
MPC837xERDB MPC837x diff --git a/board/Marvell/dreamplug/Makefile b/board/Marvell/dreamplug/Makefile new file mode 100644 index 0000000..9ee5406 --- /dev/null +++ b/board/Marvell/dreamplug/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := dreamplug.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..cff3e9d --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c @@ -0,0 +1,154 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 + */ + +#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "dreamplug.h" + +DECLARE_GLOBAL_DATA_PTR; + +int board_early_init_f(void) +{ + /* + * default gpio configuration + * There are maximum 64 gpios controlled through 2 sets of registers + * the below configuration configures mainly initial LED status + */ + kw_config_gpio(DREAMPLUG_OE_VAL_LOW, + DREAMPLUG_OE_VAL_HIGH, + DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH); + + /* Multi-Purpose Pins Functionality configuration */ + u32 kwmpp_config[] = { + MPP0_SPI_SCn, /* SPI Flash */ + MPP1_SPI_MOSI, + MPP2_SPI_SCK, + MPP3_SPI_MISO, + MPP4_NF_IO6, + MPP5_NF_IO7, + MPP6_SYSRST_OUTn, + MPP7_GPO, + MPP8_TW_SDA, + MPP9_TW_SCK, + MPP10_UART0_TXD, /* Serial */ + MPP11_UART0_RXD, + MPP12_SD_CLK, /* SDIO Slot */ + MPP13_SD_CMD, + MPP14_SD_D0, + MPP15_SD_D1, + MPP16_SD_D2, + MPP17_SD_D3, + MPP18_NF_IO0, + MPP19_NF_IO1, + MPP20_GE1_0, /* Gigabit Ethernet */ + MPP21_GE1_1, + MPP22_GE1_2, + MPP23_GE1_3, + MPP24_GE1_4, + MPP25_GE1_5, + MPP26_GE1_6, + MPP27_GE1_7, + MPP28_GE1_8, + MPP29_GE1_9, + MPP30_GE1_10, + MPP31_GE1_11, + MPP32_GE1_12, + MPP33_GE1_13, + MPP34_GE1_14, + MPP35_GE1_15, + MPP36_GPIO, /* 7 external GPIO pins (36 - 45) */ + MPP37_GPIO, + MPP38_GPIO, + MPP39_GPIO, + MPP40_TDM_SPI_SCK, + MPP41_TDM_SPI_MISO, + MPP42_TDM_SPI_MOSI, + MPP43_GPIO, + MPP44_GPIO, + MPP45_GPIO, + MPP46_GPIO, /* Wifi AP LED */ + MPP47_GPIO, + MPP48_GPIO, /* Wifi LED */ + MPP49_GPIO, + 0 + }; + kirkwood_mpp_conf(kwmpp_config); + return 0; +} + +int board_init(void) +{ + /* arch number of board */ + gd->bd->bi_arch_number = MACH_TYPE_DREAMPLUG; + + /* adress of boot parameters */ + gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; + + return 0; +} + +#ifdef CONFIG_RESET_PHY_R +void mv_phy_88e1116_init(char *name) +{ + u16 reg; + u16 devadr; + + if (miiphy_set_current_dev(name)) + return; + + /* command to read PHY dev address */ + if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { + printf("Err..%s could not read PHY dev address\n", + __func__); + return; + } + + /* + * Enable RGMII delay on Tx and Rx for CPU port + * Ref: sec 4.7.2 of chip datasheet + */ + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2); + miiphy_read(name, devadr, MV88E1116_MAC_CTRL2_REG, ®); + reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); + miiphy_write(name, devadr, MV88E1116_MAC_CTRL2_REG, reg); + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); + + /* reset the phy */ + miiphy_reset(name, devadr); + + printf("88E1116 Initialized on %s\n", name); +} + +void reset_phy(void) +{ + /* configure and initialize both PHY's */ + mv_phy_88e1116_init("egiga0"); + mv_phy_88e1116_init("egiga1"); +} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h new file mode 100644 index 0000000..ad5ffcf --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.h @@ -0,0 +1,42 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 __DREAMPLUG_H +#define __DREAMPLUG_H + +#define DREAMPLUG_OE_LOW (~(0)) +#define DREAMPLUG_OE_HIGH (~(0)) +#define DREAMPLUG_OE_VAL_LOW 0 +#define DREAMPLUG_OE_VAL_HIGH (0xf << 16) /* 4 LED Pins high */ + +/* PHY related */ +#define MV88E1116_MAC_CTRL2_REG 21 +#define MV88E1116_PGADR_REG 22 +#define MV88E1116_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1116_RGMII_RXTM_CTRL (1 << 5) + +#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg new file mode 100644 index 0000000..ca9cd74 --- /dev/null +++ b/board/Marvell/dreamplug/kwbimage.cfg @@ -0,0 +1,163 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM spi + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0/1 interface pad voltage to 1.8V +DATA 0xFFD100e0 0x1b1b9b9b + +#Dram initalization for SINGLE x16 CL=5 @ 400MHz +DATA 0xFFD01400 0x43000c30 # DDR Configuration register +# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01 + +DATA 0xFFD01404 0x37543000 # DDR Controller Control Low +# bit 4: 0=addr/cmd in smame cycle +# bit 5: 0=clk is driven during self refresh, we don't care for APX +# bit 6: 0=use recommended falling edge of clk for addr/cmd +# bit14: 0=input buffer always powered up +# bit18: 1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31: 0=no additional STARTBURST delay + +DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) +# bit3-0: TRAS lsbs +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20: TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP + +DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required + +DATA 0xFFD01410 0x000000cc # DDR Address Control +# bit1-0: 01, Cs0width=x8 +# bit3-2: 10, Cs0size=1Gb +# bit5-4: 01, Cs1width=x8 +# bit7-6: 10, Cs1size=1Gb +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16: 0, Cs0AddrSel +# bit17: 0, Cs1AddrSel +# bit18: 0, Cs2AddrSel +# bit19: 0, Cs3AddrSel +# bit31-20: 0 required + +DATA 0xFFD01414 0x00000000 # DDR Open Pages Control +# bit0: 0, OpenPage enabled +# bit31-1: 0 required + +DATA 0xFFD01418 0x00000000 # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required + +DATA 0xFFD0141C 0x00000C52 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery ???????????? +# bit12: 0, PD must be zero +# bit31-13: 0 required + +DATA 0xFFD01420 0x00000040 # DDR Extended Mode +# bit0: 0, DDR DLL enabled +# bit1: 0, DDR drive strenght normal +# bit2: 0, DDR ODT control lsd (disabled) +# bit5-3: 000, required +# bit6: 1, DDR ODT control msb, (disabled) +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required + +DATA 0xFFD01424 0x0000F17F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 0 +# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz +# bit9 : 0 , no half clock cycle addition to dataout +# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals +# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh +# bit15-12: 1111 required +# bit31-16: 0 required + +DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) +DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) + +DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 +DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size +# bit0: 1, Window enabled +# bit1: 0, Write Protect disabled +# bit3-2: 00, CS0 hit selected +# bit23-4: ones, required +# bit31-24: 0x0F, Size (i.e. 256MB) + +DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb +DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 + +DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled +DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled + +DATA 0xFFD01494 0x00030000 # DDR ODT Control (Low) +DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) +# bit1-0: 00, ODT0 controlled by ODT Control (low) register above +# bit3-2: 01, ODT1 active NEVER! +# bit31-4: zero, required + +DATA 0xFFD0149C 0x0000E803 # CPU ODT Control +DATA 0xFFD01480 0x00000001 # DDR Initialization Control +#bit0=1, enable DDR init upon this register write + +# End of Header extension +DATA 0x0 0x0 diff --git a/boards.cfg b/boards.cfg index 8a5bfc1..cceda57 100644 --- a/boards.cfg +++ b/boards.cfg @@ -135,6 +135,7 @@ portl2 arm arm926ejs km_arm keymile inetspace_v2 arm arm926ejs netspace_v2 LaCie kirkwood netspace_v2:INETSPACE_V2 netspace_v2 arm arm926ejs netspace_v2 LaCie kirkwood netspace_v2:NETSPACE_V2 netspace_max_v2 arm arm926ejs netspace_v2 LaCie kirkwood netspace_v2:NETSPACE_MAX_V2 +dreamplug arm arm926ejs - Marvell kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..003d201 --- /dev/null +++ b/include/configs/dreamplug.h @@ -0,0 +1,158 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 _CONFIG_DREAMPLUG_H +#define _CONFIG_DREAMPLUG_H + +/* + * FIXME: This belongs in mach-types.h. However, we only pull mach-types + * from Linus' kernel.org tree. This hasn't been updated primarily due to + * the recent arch/arm reshuffling. So, in the meantime, we'll place it + * here. + */ +#define MACH_TYPE_DREAMPLUG 3550 + +#ifdef CONFIG_MACH_DREAMPLUG +# ifdef machine_arch_type +# undef machine_arch_type +# define machine_arch_type __machine_arch_type +# else +# define machine_arch_type MACH_TYPE_DREAMPLUG +# endif +# define machine_is_dreamplug() (machine_arch_type == MACH_TYPE_DREAMPLUG) +#else +# define machine_is_dreamplug() (0) +#endif + +/* + * Version number information + */ +#define CONFIG_IDENT_STRING "\nMarvell-DreamPlug" + +/* + * High Level Configuration Options (easy to change) + */ +#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_DREAMPLUG /* Machine type */ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* + * Commands configuration + */ +#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#include <config_cmd_default.h> +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ENV +#define CONFIG_CMD_FAT +#define CONFIG_CMD_SF +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_CMD_IDE +#define CONFIG_CMD_DATE + +/* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros + */ +#include "mv-common.h" + +/* + * Environment variables configurations + */ +#ifdef CONFIG_SPI_FLASH +#define CONFIG_ENV_IS_IN_SPI_FLASH 1 +#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64k */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif + +#ifdef CONFIG_CMD_SF +#define CONFIG_SPI_FLASH 1 +#define CONFIG_HARD_SPI 1 +#define CONFIG_KIRKWOOD_SPI 1 +#define CONFIG_SPI_FLASH_MACRONIX 1 +#define CONFIG_ENV_SPI_BUS 0 +#define CONFIG_ENV_SPI_CS 0 +#define CONFIG_ENV_SPI_MAX_HZ 50000000 /* 50 MHz */ +#endif + +/* + * max 4k env size is enough, but in case of nand + * it has to be rounded to sector size + */ +#define CONFIG_ENV_SIZE 0x1000 /* 4k */ +#define CONFIG_ENV_ADDR 0x100000 +#define CONFIG_ENV_OFFSET 0x100000 /* env starts here */ + +/* + * Default environment variables + */ +#define CONFIG_BOOTCOMMAND "setenv ethact egiga0; " \ + "${x_bootcmd_ethernet}; setenv ethact egiga1; " \ + "${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; "\ + "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ + "bootm 0x6400000;" + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "x_bootcmd_ethernet=ping 192.168.2.1\0" \ + "x_bootcmd_usb=usb start\0" \ + "x_bootcmd_kernel=fatload usb 0 0x6400000 uImage\0" \ + "x_bootargs=console=ttyS0,115200\0" \ + "x_bootargs_root=root=/dev/sda2 rootdelay=10\0" + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +#define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +#define CONFIG_PHY_BASE_ADR 0 +#endif /* CONFIG_CMD_NET */ + +/* + * SATA Driver configuration + */ +#ifdef CONFIG_MVSATA_IDE +#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET +#endif /*CONFIG_MVSATA_IDE*/ + +/* + * RTC driver configuration + */ +#ifdef CONFIG_CMD_DATE +#define CONFIG_RTC_MV +#endif /* CONFIG_CMD_DATE */ + +#define CONFIG_SYS_ALT_MEMTEST + +/* + * display enhanced info about the cpu at boot. + */ +#define CONFIG_DISPLAY_CPUINFO + +#endif /* _CONFIG_DREAMPLUG_H */

Sorry for jumping in that late...
On 09/12/11 01:10, u-boot@lakedaemon.net wrote:
From: Jason Cooper u-boot@lakedaemon.net
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
[...]
diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..cff3e9d --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c
[...]
+int board_init(void) +{
- /* arch number of board */
- gd->bd->bi_arch_number = MACH_TYPE_DREAMPLUG;
This should be done in the board config file. Please, see the CONFIG_MACH_TYPE in the U-Boot documentation (README file).
[...]
diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..003d201 --- /dev/null +++ b/include/configs/dreamplug.h
[...]
+/*
- FIXME: This belongs in mach-types.h. However, we only pull mach-types
- from Linus' kernel.org tree. This hasn't been updated primarily due to
- the recent arch/arm reshuffling. So, in the meantime, we'll place it
- here.
- */
+#define MACH_TYPE_DREAMPLUG 3550
+#ifdef CONFIG_MACH_DREAMPLUG +# ifdef machine_arch_type +# undef machine_arch_type +# define machine_arch_type __machine_arch_type +# else +# define machine_arch_type MACH_TYPE_DREAMPLUG +# endif +# define machine_is_dreamplug() (machine_arch_type == MACH_TYPE_DREAMPLUG) +#else +# define machine_is_dreamplug() (0) +#endif
#define CONFIG_MACH_TYPE MACH_TYPE_DREAMPLUG should be added here... and should remain after you remove the above as in FIXME.

On Mon, Sep 12, 2011 at 10:37:37AM +0300, Igor Grinberg wrote:
Sorry for jumping in that late...
Well, it hasn't been merged yet, so it's not too late in my book. ;-)
On 09/12/11 01:10, u-boot@lakedaemon.net wrote:
From: Jason Cooper u-boot@lakedaemon.net
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
[...]
diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..cff3e9d --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c
[...]
+int board_init(void) +{
- /* arch number of board */
- gd->bd->bi_arch_number = MACH_TYPE_DREAMPLUG;
This should be done in the board config file. Please, see the CONFIG_MACH_TYPE in the U-Boot documentation (README file).
Will do, v7 cued up.
[...]
diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..003d201 --- /dev/null +++ b/include/configs/dreamplug.h
[...]
+/*
- FIXME: This belongs in mach-types.h. However, we only pull mach-types
- from Linus' kernel.org tree. This hasn't been updated primarily due to
- the recent arch/arm reshuffling. So, in the meantime, we'll place it
- here.
- */
+#define MACH_TYPE_DREAMPLUG 3550
+#ifdef CONFIG_MACH_DREAMPLUG +# ifdef machine_arch_type +# undef machine_arch_type +# define machine_arch_type __machine_arch_type +# else +# define machine_arch_type MACH_TYPE_DREAMPLUG +# endif +# define machine_is_dreamplug() (machine_arch_type == MACH_TYPE_DREAMPLUG) +#else +# define machine_is_dreamplug() (0) +#endif
#define CONFIG_MACH_TYPE MACH_TYPE_DREAMPLUG should be added here... and should remain after you remove the above as in FIXME.
Thanks for the review!
thx,
Jason.

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net --- Changes from v1 to v2:
- resorted series to move 'make all' support last.
Changes from v2 to v3:
- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux. - Update MAINTAINERS. - Collapse into one patch.
Changes from v3 to v4:
- update copyright info as recommended by Prafulla Wadaskar. - maintain proper order in boards.cfg, MAINTAINERS, etc. - label MPP's - change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).
Changes from v4 to v5:
- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech. - Added driver for integrated RTC. (thx GST!) - Added support for displaying CPU frequencies at boot. (thx GST!) - Adjust USB timeout to handle dreamplug EHCI chipset. - Cleaned up MPP registers based on Global Scale code. (thx GST!) - broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to use MACH_TYPE_DREAMPLUG.
Changes from v5 to v6:
- Define MACH_TYPE_DREAMPLUG in includes/configs/dreamplug.h until Linus's kernel.org tree includes assigned machine id. This is on Wolfgang's recommendation [1]. - Removed dcache disabling as it is no longer enabled by default. - USB timeout fix was merged. - Marvell Integrated RTC was merged. - Dropped CPU frequency printout as I'm not familiar enough with all flavors of kirkwood SoCs to do it correctly. - Labelled MPP*_GPIO pins that are broken out as gpio pins for the user. - Fixed function name mv_phy_88e1121_init() -> mv_phy_88e1116_init().
Changes from v6 to v7:
- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h
[1] http://www.mail-archive.com/u-boot@lists.denx.de/msg60921.html
MAINTAINERS | 4 + board/Marvell/dreamplug/Makefile | 54 ++++++++ board/Marvell/dreamplug/dreamplug.c | 154 +++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 +++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 159 ++++++++++++++++++++++++ 7 files changed, 577 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
diff --git a/MAINTAINERS b/MAINTAINERS index 2f60a60..88d5637 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,10 @@ Conn Clark clark@esteem.com
ESTEEM192E MPC8xx
+Jason Cooper u-boot@lakedaemon.net + + dreamplug ARM926EJS (Kirkwood SoC) + Joe D'Abbraccio ljd015@freescale.com
MPC837xERDB MPC837x diff --git a/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s b/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s new file mode 100644 index 0000000..e69de29 diff --git a/board/Marvell/dreamplug/Makefile b/board/Marvell/dreamplug/Makefile new file mode 100644 index 0000000..9ee5406 --- /dev/null +++ b/board/Marvell/dreamplug/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := dreamplug.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..05098fa --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c @@ -0,0 +1,154 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 + */ + +#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "dreamplug.h" + +DECLARE_GLOBAL_DATA_PTR; + +int board_early_init_f(void) +{ + /* + * default gpio configuration + * There are maximum 64 gpios controlled through 2 sets of registers + * the below configuration configures mainly initial LED status + */ + kw_config_gpio(DREAMPLUG_OE_VAL_LOW, + DREAMPLUG_OE_VAL_HIGH, + DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH); + + /* Multi-Purpose Pins Functionality configuration */ + u32 kwmpp_config[] = { + MPP0_SPI_SCn, /* SPI Flash */ + MPP1_SPI_MOSI, + MPP2_SPI_SCK, + MPP3_SPI_MISO, + MPP4_NF_IO6, + MPP5_NF_IO7, + MPP6_SYSRST_OUTn, + MPP7_GPO, + MPP8_TW_SDA, + MPP9_TW_SCK, + MPP10_UART0_TXD, /* Serial */ + MPP11_UART0_RXD, + MPP12_SD_CLK, /* SDIO Slot */ + MPP13_SD_CMD, + MPP14_SD_D0, + MPP15_SD_D1, + MPP16_SD_D2, + MPP17_SD_D3, + MPP18_NF_IO0, + MPP19_NF_IO1, + MPP20_GE1_0, /* Gigabit Ethernet */ + MPP21_GE1_1, + MPP22_GE1_2, + MPP23_GE1_3, + MPP24_GE1_4, + MPP25_GE1_5, + MPP26_GE1_6, + MPP27_GE1_7, + MPP28_GE1_8, + MPP29_GE1_9, + MPP30_GE1_10, + MPP31_GE1_11, + MPP32_GE1_12, + MPP33_GE1_13, + MPP34_GE1_14, + MPP35_GE1_15, + MPP36_GPIO, /* 7 external GPIO pins (36 - 45) */ + MPP37_GPIO, + MPP38_GPIO, + MPP39_GPIO, + MPP40_TDM_SPI_SCK, + MPP41_TDM_SPI_MISO, + MPP42_TDM_SPI_MOSI, + MPP43_GPIO, + MPP44_GPIO, + MPP45_GPIO, + MPP46_GPIO, /* Wifi AP LED */ + MPP47_GPIO, + MPP48_GPIO, /* Wifi LED */ + MPP49_GPIO, + 0 + }; + kirkwood_mpp_conf(kwmpp_config); + return 0; +} + +int board_init(void) +{ + /* arch number of board */ + gd->bd->bi_arch_number = CONFIG_MACH_TYPE; + + /* adress of boot parameters */ + gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; + + return 0; +} + +#ifdef CONFIG_RESET_PHY_R +void mv_phy_88e1116_init(char *name) +{ + u16 reg; + u16 devadr; + + if (miiphy_set_current_dev(name)) + return; + + /* command to read PHY dev address */ + if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { + printf("Err..%s could not read PHY dev address\n", + __func__); + return; + } + + /* + * Enable RGMII delay on Tx and Rx for CPU port + * Ref: sec 4.7.2 of chip datasheet + */ + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2); + miiphy_read(name, devadr, MV88E1116_MAC_CTRL2_REG, ®); + reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); + miiphy_write(name, devadr, MV88E1116_MAC_CTRL2_REG, reg); + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); + + /* reset the phy */ + miiphy_reset(name, devadr); + + printf("88E1116 Initialized on %s\n", name); +} + +void reset_phy(void) +{ + /* configure and initialize both PHY's */ + mv_phy_88e1116_init("egiga0"); + mv_phy_88e1116_init("egiga1"); +} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h new file mode 100644 index 0000000..ad5ffcf --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.h @@ -0,0 +1,42 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 __DREAMPLUG_H +#define __DREAMPLUG_H + +#define DREAMPLUG_OE_LOW (~(0)) +#define DREAMPLUG_OE_HIGH (~(0)) +#define DREAMPLUG_OE_VAL_LOW 0 +#define DREAMPLUG_OE_VAL_HIGH (0xf << 16) /* 4 LED Pins high */ + +/* PHY related */ +#define MV88E1116_MAC_CTRL2_REG 21 +#define MV88E1116_PGADR_REG 22 +#define MV88E1116_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1116_RGMII_RXTM_CTRL (1 << 5) + +#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg new file mode 100644 index 0000000..ca9cd74 --- /dev/null +++ b/board/Marvell/dreamplug/kwbimage.cfg @@ -0,0 +1,163 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM spi + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0/1 interface pad voltage to 1.8V +DATA 0xFFD100e0 0x1b1b9b9b + +#Dram initalization for SINGLE x16 CL=5 @ 400MHz +DATA 0xFFD01400 0x43000c30 # DDR Configuration register +# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01 + +DATA 0xFFD01404 0x37543000 # DDR Controller Control Low +# bit 4: 0=addr/cmd in smame cycle +# bit 5: 0=clk is driven during self refresh, we don't care for APX +# bit 6: 0=use recommended falling edge of clk for addr/cmd +# bit14: 0=input buffer always powered up +# bit18: 1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31: 0=no additional STARTBURST delay + +DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) +# bit3-0: TRAS lsbs +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20: TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP + +DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required + +DATA 0xFFD01410 0x000000cc # DDR Address Control +# bit1-0: 01, Cs0width=x8 +# bit3-2: 10, Cs0size=1Gb +# bit5-4: 01, Cs1width=x8 +# bit7-6: 10, Cs1size=1Gb +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16: 0, Cs0AddrSel +# bit17: 0, Cs1AddrSel +# bit18: 0, Cs2AddrSel +# bit19: 0, Cs3AddrSel +# bit31-20: 0 required + +DATA 0xFFD01414 0x00000000 # DDR Open Pages Control +# bit0: 0, OpenPage enabled +# bit31-1: 0 required + +DATA 0xFFD01418 0x00000000 # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required + +DATA 0xFFD0141C 0x00000C52 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery ???????????? +# bit12: 0, PD must be zero +# bit31-13: 0 required + +DATA 0xFFD01420 0x00000040 # DDR Extended Mode +# bit0: 0, DDR DLL enabled +# bit1: 0, DDR drive strenght normal +# bit2: 0, DDR ODT control lsd (disabled) +# bit5-3: 000, required +# bit6: 1, DDR ODT control msb, (disabled) +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required + +DATA 0xFFD01424 0x0000F17F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 0 +# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz +# bit9 : 0 , no half clock cycle addition to dataout +# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals +# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh +# bit15-12: 1111 required +# bit31-16: 0 required + +DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) +DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) + +DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 +DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size +# bit0: 1, Window enabled +# bit1: 0, Write Protect disabled +# bit3-2: 00, CS0 hit selected +# bit23-4: ones, required +# bit31-24: 0x0F, Size (i.e. 256MB) + +DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb +DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 + +DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled +DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled + +DATA 0xFFD01494 0x00030000 # DDR ODT Control (Low) +DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) +# bit1-0: 00, ODT0 controlled by ODT Control (low) register above +# bit3-2: 01, ODT1 active NEVER! +# bit31-4: zero, required + +DATA 0xFFD0149C 0x0000E803 # CPU ODT Control +DATA 0xFFD01480 0x00000001 # DDR Initialization Control +#bit0=1, enable DDR init upon this register write + +# End of Header extension +DATA 0x0 0x0 diff --git a/boards.cfg b/boards.cfg index 8a5bfc1..cceda57 100644 --- a/boards.cfg +++ b/boards.cfg @@ -135,6 +135,7 @@ portl2 arm arm926ejs km_arm keymile inetspace_v2 arm arm926ejs netspace_v2 LaCie kirkwood netspace_v2:INETSPACE_V2 netspace_v2 arm arm926ejs netspace_v2 LaCie kirkwood netspace_v2:NETSPACE_V2 netspace_max_v2 arm arm926ejs netspace_v2 LaCie kirkwood netspace_v2:NETSPACE_MAX_V2 +dreamplug arm arm926ejs - Marvell kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..a7168bd --- /dev/null +++ b/include/configs/dreamplug.h @@ -0,0 +1,159 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 _CONFIG_DREAMPLUG_H +#define _CONFIG_DREAMPLUG_H + +/* + * FIXME: This belongs in mach-types.h. However, we only pull mach-types + * from Linus' kernel.org tree. This hasn't been updated primarily due to + * the recent arch/arm reshuffling. So, in the meantime, we'll place it + * here. + */ +#define MACH_TYPE_DREAMPLUG 3550 + +#ifdef CONFIG_MACH_DREAMPLUG +# ifdef machine_arch_type +# undef machine_arch_type +# define machine_arch_type __machine_arch_type +# else +# define machine_arch_type MACH_TYPE_DREAMPLUG +# endif +# define machine_is_dreamplug() (machine_arch_type == MACH_TYPE_DREAMPLUG) +#else +# define machine_is_dreamplug() (0) +#endif + +/* + * Version number information + */ +#define CONFIG_IDENT_STRING "\nMarvell-DreamPlug" + +/* + * High Level Configuration Options (easy to change) + */ +#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_TYPE MACH_TYPE_DREAMPLUG +#define CONFIG_MACH_DREAMPLUG /* Machine type */ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* + * Commands configuration + */ +#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#include <config_cmd_default.h> +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ENV +#define CONFIG_CMD_FAT +#define CONFIG_CMD_SF +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_CMD_IDE +#define CONFIG_CMD_DATE + +/* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros + */ +#include "mv-common.h" + +/* + * Environment variables configurations + */ +#ifdef CONFIG_SPI_FLASH +#define CONFIG_ENV_IS_IN_SPI_FLASH 1 +#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64k */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif + +#ifdef CONFIG_CMD_SF +#define CONFIG_SPI_FLASH 1 +#define CONFIG_HARD_SPI 1 +#define CONFIG_KIRKWOOD_SPI 1 +#define CONFIG_SPI_FLASH_MACRONIX 1 +#define CONFIG_ENV_SPI_BUS 0 +#define CONFIG_ENV_SPI_CS 0 +#define CONFIG_ENV_SPI_MAX_HZ 50000000 /* 50 MHz */ +#endif + +/* + * max 4k env size is enough, but in case of nand + * it has to be rounded to sector size + */ +#define CONFIG_ENV_SIZE 0x1000 /* 4k */ +#define CONFIG_ENV_ADDR 0x100000 +#define CONFIG_ENV_OFFSET 0x100000 /* env starts here */ + +/* + * Default environment variables + */ +#define CONFIG_BOOTCOMMAND "setenv ethact egiga0; " \ + "${x_bootcmd_ethernet}; setenv ethact egiga1; " \ + "${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; "\ + "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ + "bootm 0x6400000;" + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "x_bootcmd_ethernet=ping 192.168.2.1\0" \ + "x_bootcmd_usb=usb start\0" \ + "x_bootcmd_kernel=fatload usb 0 0x6400000 uImage\0" \ + "x_bootargs=console=ttyS0,115200\0" \ + "x_bootargs_root=root=/dev/sda2 rootdelay=10\0" + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +#define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +#define CONFIG_PHY_BASE_ADR 0 +#endif /* CONFIG_CMD_NET */ + +/* + * SATA Driver configuration + */ +#ifdef CONFIG_MVSATA_IDE +#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET +#endif /*CONFIG_MVSATA_IDE*/ + +/* + * RTC driver configuration + */ +#ifdef CONFIG_CMD_DATE +#define CONFIG_RTC_MV +#endif /* CONFIG_CMD_DATE */ + +#define CONFIG_SYS_ALT_MEMTEST + +/* + * display enhanced info about the cpu at boot. + */ +#define CONFIG_DISPLAY_CPUINFO + +#endif /* _CONFIG_DREAMPLUG_H */

On 09/12/11 14:45, Jason Cooper wrote:
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
[...]
Changes from v6 to v7:
- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h
Sorry, but you've got me wrong... All you need to do is define the CONFIG_MACH_TYPE in your config file. The rest will be taken care of by the common code. See below for details.
[...]
diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..05098fa --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c
[...]
+int board_init(void) +{
- /* arch number of board */
- gd->bd->bi_arch_number = CONFIG_MACH_TYPE;
the above two line should be removed.
[...]
diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..a7168bd --- /dev/null +++ b/include/configs/dreamplug.h
[...]
+/*
- FIXME: This belongs in mach-types.h. However, we only pull mach-types
- from Linus' kernel.org tree. This hasn't been updated primarily due to
- the recent arch/arm reshuffling. So, in the meantime, we'll place it
- here.
- */
+#define MACH_TYPE_DREAMPLUG 3550
+#ifdef CONFIG_MACH_DREAMPLUG +# ifdef machine_arch_type +# undef machine_arch_type +# define machine_arch_type __machine_arch_type +# else +# define machine_arch_type MACH_TYPE_DREAMPLUG +# endif +# define machine_is_dreamplug() (machine_arch_type == MACH_TYPE_DREAMPLUG) +#else +# define machine_is_dreamplug() (0) +#endif
Do you actually use the machine_is_dreamplug() macro in your code? If you don't, then you don't need the above block at all.
+/*
- Version number information
- */
+#define CONFIG_IDENT_STRING "\nMarvell-DreamPlug"
+/*
- High Level Configuration Options (easy to change)
- */
+#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_TYPE MACH_TYPE_DREAMPLUG
The above line is all what you need to setup the machine id (along with MACH_TYPE_DREAMPLUG definition of course, unless it is in mach_type file).
+#define CONFIG_MACH_DREAMPLUG /* Machine type */
shouldn't the above be defined before the machine_is_... block? If you don't need the machine_is_dreamplug() macro, then you also don't need the above line.
[...]

On Tue, Sep 13, 2011 at 10:32:41AM +0300, Igor Grinberg wrote:
On 09/12/11 14:45, Jason Cooper wrote:
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
[...]
Changes from v6 to v7:
- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h
Sorry, but you've got me wrong... All you need to do is define the CONFIG_MACH_TYPE in your config file. The rest will be taken care of by the common code. See below for details.
Okay, thanks for the assist, v8 on it's way.
[...]
diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..05098fa --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c
[...]
+int board_init(void) +{
- /* arch number of board */
- gd->bd->bi_arch_number = CONFIG_MACH_TYPE;
the above two line should be removed.
[...]
diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..a7168bd --- /dev/null +++ b/include/configs/dreamplug.h
[...]
+/*
- FIXME: This belongs in mach-types.h. However, we only pull mach-types
- from Linus' kernel.org tree. This hasn't been updated primarily due to
- the recent arch/arm reshuffling. So, in the meantime, we'll place it
- here.
- */
+#define MACH_TYPE_DREAMPLUG 3550
+#ifdef CONFIG_MACH_DREAMPLUG +# ifdef machine_arch_type +# undef machine_arch_type +# define machine_arch_type __machine_arch_type +# else +# define machine_arch_type MACH_TYPE_DREAMPLUG +# endif +# define machine_is_dreamplug() (machine_arch_type == MACH_TYPE_DREAMPLUG) +#else +# define machine_is_dreamplug() (0) +#endif
Do you actually use the machine_is_dreamplug() macro in your code? If you don't, then you don't need the above block at all.
+/*
- Version number information
- */
+#define CONFIG_IDENT_STRING "\nMarvell-DreamPlug"
+/*
- High Level Configuration Options (easy to change)
- */
+#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_TYPE MACH_TYPE_DREAMPLUG
The above line is all what you need to setup the machine id (along with MACH_TYPE_DREAMPLUG definition of course, unless it is in mach_type file).
+#define CONFIG_MACH_DREAMPLUG /* Machine type */
shouldn't the above be defined before the machine_is_... block? If you don't need the machine_is_dreamplug() macro, then you also don't need the above line.
[...]
-- Regards, Igor.

-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Monday, September 12, 2011 5:15 PM To: wd@denx.de Cc: u-boot@lists.denx.de; u-boot@lakedaemon.net; Prafulla Wadaskar; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore Subject: [PATCH v7] dreamplug: initial board support.
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from dreamplug.h.
Hi Jason This issues it heating up for some other boards too. Let's have Wolfgang's opinion on this, since this not aligned with current u-boot development strategy.
May be we can create a separate header file for tracking (unsupported/tobe supported) arm machine-types.
Regards.. Prafulla . .

Dear Prafulla,
In message F766E4F80769BD478052FB6533FA745D1A114670B3@SC-VEXCH4.marvell.com you wrote:
Let's have Wolfgang's opinion on this, since this not aligned with current u-boot development strategy.
May be we can create a separate header file for tracking (unsupported/tobe supported) arm machine-types.
Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.
Best regards,
Wolfgang Denk

Albert,
On Tue, Sep 13, 2011 at 03:00:59PM +0200, Wolfgang Denk wrote:
Dear Prafulla,
In message F766E4F80769BD478052FB6533FA745D1A114670B3@SC-VEXCH4.marvell.com you wrote:
Let's have Wolfgang's opinion on this, since this not aligned with current u-boot development strategy.
May be we can create a separate header file for tracking (unsupported/tobe supported) arm machine-types.
Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.
Wolfgang, Marek Vasut, and I discussed this here [1]. To summarize, by declaring non-mainlined mach_types in the respective board config, an error will be thrown at compile time after mach-types.h is updated to include the mach_type.
The other idea is to have a separate file, say mach-types-local.h where all non-mainlined mach-types would be defined.
Thoughts? I can do whichever.
thx,
Jason.
[1] http://www.mail-archive.com/u-boot@lists.denx.de/msg60921.html

-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Tuesday, September 13, 2011 7:47 PM To: Wolfgang Denk Cc: Prafulla Wadaskar; Albert Aribaud; u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH v7] dreamplug: initial board support.
Albert,
On Tue, Sep 13, 2011 at 03:00:59PM +0200, Wolfgang Denk wrote:
Dear Prafulla,
In message <F766E4F80769BD478052FB6533FA745D1A114670B3@SC-
VEXCH4.marvell.com> you wrote:
Let's have Wolfgang's opinion on this, since this not aligned with
current
u-boot development strategy.
May be we can create a separate header file for tracking
(unsupported/tobe
supported) arm machine-types.
Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.
Wolfgang, Marek Vasut, and I discussed this here [1]. To summarize, by declaring non-mainlined mach_types in the respective board config, an error will be thrown at compile time after mach-types.h is updated to include the mach_type.
The other idea is to have a separate file, say mach-types-local.h where all non-mainlined mach-types would be defined.
I will vote for this second approach so that it becomes independent change and anyone can update it in future.
Let's get Albert's opinion on this.
Regards.. Prafulla . .
Thoughts? I can do whichever.
thx,
Jason.
[1] http://www.mail-archive.com/u-boot@lists.denx.de/msg60921.html

(Please do not use my @free.fr address to copy me on U-boot matters...)
Le 14/09/2011 08:39, Prafulla Wadaskar a écrit :
-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Tuesday, September 13, 2011 7:47 PM To: Wolfgang Denk Cc: Prafulla Wadaskar; Albert Aribaud; u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH v7] dreamplug: initial board support.
Albert,
On Tue, Sep 13, 2011 at 03:00:59PM +0200, Wolfgang Denk wrote:
Dear Prafulla,
In message<F766E4F80769BD478052FB6533FA745D1A114670B3@SC-
VEXCH4.marvell.com> you wrote:
Let's have Wolfgang's opinion on this, since this not aligned with
current
u-boot development strategy.
May be we can create a separate header file for tracking
(unsupported/tobe
supported) arm machine-types.
Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.
Wolfgang, Marek Vasut, and I discussed this here [1]. To summarize, by declaring non-mainlined mach_types in the respective board config, an error will be thrown at compile time after mach-types.h is updated to include the mach_type.
The other idea is to have a separate file, say mach-types-local.h where all non-mainlined mach-types would be defined.
I will vote for this second approach so that it becomes independent change and anyone can update it in future.
Let's get Albert's opinion on this.
My opinion on the whole mach-type question is "if a board needs a mach-type it's because it will run Linux, so its mach-type should eventually be in the Linux mach-type list". As I understand it, the only case when is not there is because U-Boot support is submitted before Linux mainline support. Thus I second the idea of defining it in the board config header file, possibly even testing for it first and if it already exists, throwing a #error to remind the board maintainer to remove the now useless define from the config file.
Regards.. Prafulla . .
Amicalement,

Le 18/09/2011 19:58, Albert ARIBAUD a écrit :
eventually be in the Linux mach-type list". As I understand it, the only case when is not there is because U-Boot support is submitted before
make that "... when *it* is not there..."
Amicalement,

Albert, Prafulla, Wolfgang,
On Sun, Sep 18, 2011 at 07:58:14PM +0200, Albert ARIBAUD wrote:
Le 14/09/2011 08:39, Prafulla Wadaskar a écrit :
On Tue, Sep 13, 2011 at 03:00:59PM +0200, Wolfgang Denk wrote:
In messageF766E4F80769BD478052FB6533FA745D1A114670B3@SC-VEXCH4.marvell.com you wrote:
Let's have Wolfgang's opinion on this, since this not aligned with current u-boot development strategy.
May be we can create a separate header file for tracking (unsupported/tobe supported) arm machine-types.
Actually this is for Albert to comment. He is the ARM custodian and has to live with the results.
Wolfgang, Marek Vasut, and I discussed this here [1]. To summarize, by declaring non-mainlined mach_types in the respective board config, an error will be thrown at compile time after mach-types.h is updated to include the mach_type.
The other idea is to have a separate file, say mach-types-local.h where all non-mainlined mach-types would be defined.
I will vote for this second approach so that it becomes independent change and anyone can update it in future.
Let's get Albert's opinion on this.
My opinion on the whole mach-type question is "if a board needs a mach-type it's because it will run Linux, so its mach-type should eventually be in the Linux mach-type list". As I understand it, the only case when is not there is because U-Boot support is submitted before Linux mainline support.
Yes, this is true. There is also the corner case where the developer motivated to do the work (me) is still learning devicetree, and Linux won't take new boards for arm unless they are clearly devicetree. :-)
Thus I second the idea of defining it in the board config header file, possibly even testing for it first and if it already exists, throwing a #error to remind the board maintainer to remove the now useless define from the config file.
Sounds good, I should have a new version up in a few hours.
As for my original question, since this patch series has had several versions on the mailinglist [1] prior to the close of the merge window, is it still possible to get it in for 2011.09?
thx,
Jason.
[1] http://lists.denx.de/pipermail/u-boot/2011-June/094056.html

Dear Jason,
In message 20110918183913.GA32644@titan.lakedaemon.net you wrote:
As for my original question, since this patch series has had several versions on the mailinglist [1] prior to the close of the merge window, is it still possible to get it in for 2011.09?
I cannot promise this. We are already pretty much late behind schedule, and close to the (shifted) release date.
Best regards,
Wolfgang Denk

Wolfgang,
On Sun, Sep 18, 2011 at 10:28:47PM +0200, Wolfgang Denk wrote:
In message 20110918183913.GA32644@titan.lakedaemon.net you wrote:
As for my original question, since this patch series has had several versions on the mailinglist [1] prior to the close of the merge window, is it still possible to get it in for 2011.09?
I cannot promise this. We are already pretty much late behind schedule, and close to the (shifted) release date.
Ok, I hope it makes it in. If not, I understand. We didn't get the mach-types workaround hammered out until late.
thx,
Jason.

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from include/configs/dreamplug.h.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net --- Changes from v1 to v2:
- resorted series to move 'make all' support last.
Changes from v2 to v3:
- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux. - Update MAINTAINERS. - Collapse into one patch.
Changes from v3 to v4:
- update copyright info as recommended by Prafulla Wadaskar. - maintain proper order in boards.cfg, MAINTAINERS, etc. - label MPP's - change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).
Changes from v4 to v5:
- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech. - Added driver for integrated RTC. (thx GST!) - Added support for displaying CPU frequencies at boot. (thx GST!) - Adjust USB timeout to handle dreamplug EHCI chipset. - Cleaned up MPP registers based on Global Scale code. (thx GST!) - broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to use MACH_TYPE_DREAMPLUG.
Changes from v5 to v6:
- Define MACH_TYPE_DREAMPLUG in includes/configs/dreamplug.h until Linus's kernel.org tree includes assigned machine id. This is on Wolfgang's recommendation [1]. - Removed dcache disabling as it is no longer enabled by default. - USB timeout fix was merged. - Marvell Integrated RTC was merged. - Dropped CPU frequency printout as I'm not familiar enough with all flavors of kirkwood SoCs to do it correctly. - Labelled MPP*_GPIO pins that are broken out as gpio pins for the user. - Fixed function name mv_phy_88e1121_init() -> mv_phy_88e1116_init().
Changes from v6 to v7:
- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h
Changes from v7 to v8:
- #error MACH_TYPE_DREAMPLUG once it is defined in mach-types.h. On Albert Aribaud's recommendation.
[1] http://www.mail-archive.com/u-boot@lists.denx.de/msg60921.html
MAINTAINERS | 4 + board/Marvell/dreamplug/Makefile | 54 ++++++++ board/Marvell/dreamplug/dreamplug.c | 151 +++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 +++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 151 +++++++++++++++++++++++ 7 files changed, 566 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
diff --git a/MAINTAINERS b/MAINTAINERS index 2f60a60..88d5637 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,10 @@ Conn Clark clark@esteem.com
ESTEEM192E MPC8xx
+Jason Cooper u-boot@lakedaemon.net + + dreamplug ARM926EJS (Kirkwood SoC) + Joe D'Abbraccio ljd015@freescale.com
MPC837xERDB MPC837x diff --git a/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s b/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s new file mode 100644 index 0000000..e69de29 diff --git a/board/Marvell/dreamplug/Makefile b/board/Marvell/dreamplug/Makefile new file mode 100644 index 0000000..9ee5406 --- /dev/null +++ b/board/Marvell/dreamplug/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := dreamplug.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..13b4013 --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c @@ -0,0 +1,151 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 + */ + +#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "dreamplug.h" + +DECLARE_GLOBAL_DATA_PTR; + +int board_early_init_f(void) +{ + /* + * default gpio configuration + * There are maximum 64 gpios controlled through 2 sets of registers + * the below configuration configures mainly initial LED status + */ + kw_config_gpio(DREAMPLUG_OE_VAL_LOW, + DREAMPLUG_OE_VAL_HIGH, + DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH); + + /* Multi-Purpose Pins Functionality configuration */ + u32 kwmpp_config[] = { + MPP0_SPI_SCn, /* SPI Flash */ + MPP1_SPI_MOSI, + MPP2_SPI_SCK, + MPP3_SPI_MISO, + MPP4_NF_IO6, + MPP5_NF_IO7, + MPP6_SYSRST_OUTn, + MPP7_GPO, + MPP8_TW_SDA, + MPP9_TW_SCK, + MPP10_UART0_TXD, /* Serial */ + MPP11_UART0_RXD, + MPP12_SD_CLK, /* SDIO Slot */ + MPP13_SD_CMD, + MPP14_SD_D0, + MPP15_SD_D1, + MPP16_SD_D2, + MPP17_SD_D3, + MPP18_NF_IO0, + MPP19_NF_IO1, + MPP20_GE1_0, /* Gigabit Ethernet */ + MPP21_GE1_1, + MPP22_GE1_2, + MPP23_GE1_3, + MPP24_GE1_4, + MPP25_GE1_5, + MPP26_GE1_6, + MPP27_GE1_7, + MPP28_GE1_8, + MPP29_GE1_9, + MPP30_GE1_10, + MPP31_GE1_11, + MPP32_GE1_12, + MPP33_GE1_13, + MPP34_GE1_14, + MPP35_GE1_15, + MPP36_GPIO, /* 7 external GPIO pins (36 - 45) */ + MPP37_GPIO, + MPP38_GPIO, + MPP39_GPIO, + MPP40_TDM_SPI_SCK, + MPP41_TDM_SPI_MISO, + MPP42_TDM_SPI_MOSI, + MPP43_GPIO, + MPP44_GPIO, + MPP45_GPIO, + MPP46_GPIO, + MPP47_GPIO, /* Bluetooth LED */ + MPP48_GPIO, /* Wifi LED */ + MPP49_GPIO, /* Wifi AP LED */ + 0 + }; + kirkwood_mpp_conf(kwmpp_config); + return 0; +} + +int board_init(void) +{ + /* adress of boot parameters */ + gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; + + return 0; +} + +#ifdef CONFIG_RESET_PHY_R +void mv_phy_88e1116_init(char *name) +{ + u16 reg; + u16 devadr; + + if (miiphy_set_current_dev(name)) + return; + + /* command to read PHY dev address */ + if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { + printf("Err..%s could not read PHY dev address\n", + __func__); + return; + } + + /* + * Enable RGMII delay on Tx and Rx for CPU port + * Ref: sec 4.7.2 of chip datasheet + */ + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2); + miiphy_read(name, devadr, MV88E1116_MAC_CTRL2_REG, ®); + reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); + miiphy_write(name, devadr, MV88E1116_MAC_CTRL2_REG, reg); + miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); + + /* reset the phy */ + miiphy_reset(name, devadr); + + printf("88E1116 Initialized on %s\n", name); +} + +void reset_phy(void) +{ + /* configure and initialize both PHY's */ + mv_phy_88e1116_init("egiga0"); + mv_phy_88e1116_init("egiga1"); +} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h new file mode 100644 index 0000000..ad5ffcf --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.h @@ -0,0 +1,42 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 __DREAMPLUG_H +#define __DREAMPLUG_H + +#define DREAMPLUG_OE_LOW (~(0)) +#define DREAMPLUG_OE_HIGH (~(0)) +#define DREAMPLUG_OE_VAL_LOW 0 +#define DREAMPLUG_OE_VAL_HIGH (0xf << 16) /* 4 LED Pins high */ + +/* PHY related */ +#define MV88E1116_MAC_CTRL2_REG 21 +#define MV88E1116_PGADR_REG 22 +#define MV88E1116_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1116_RGMII_RXTM_CTRL (1 << 5) + +#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg new file mode 100644 index 0000000..ca9cd74 --- /dev/null +++ b/board/Marvell/dreamplug/kwbimage.cfg @@ -0,0 +1,163 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM spi + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0/1 interface pad voltage to 1.8V +DATA 0xFFD100e0 0x1b1b9b9b + +#Dram initalization for SINGLE x16 CL=5 @ 400MHz +DATA 0xFFD01400 0x43000c30 # DDR Configuration register +# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01 + +DATA 0xFFD01404 0x37543000 # DDR Controller Control Low +# bit 4: 0=addr/cmd in smame cycle +# bit 5: 0=clk is driven during self refresh, we don't care for APX +# bit 6: 0=use recommended falling edge of clk for addr/cmd +# bit14: 0=input buffer always powered up +# bit18: 1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31: 0=no additional STARTBURST delay + +DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) +# bit3-0: TRAS lsbs +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20: TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP + +DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required + +DATA 0xFFD01410 0x000000cc # DDR Address Control +# bit1-0: 01, Cs0width=x8 +# bit3-2: 10, Cs0size=1Gb +# bit5-4: 01, Cs1width=x8 +# bit7-6: 10, Cs1size=1Gb +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16: 0, Cs0AddrSel +# bit17: 0, Cs1AddrSel +# bit18: 0, Cs2AddrSel +# bit19: 0, Cs3AddrSel +# bit31-20: 0 required + +DATA 0xFFD01414 0x00000000 # DDR Open Pages Control +# bit0: 0, OpenPage enabled +# bit31-1: 0 required + +DATA 0xFFD01418 0x00000000 # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required + +DATA 0xFFD0141C 0x00000C52 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery ???????????? +# bit12: 0, PD must be zero +# bit31-13: 0 required + +DATA 0xFFD01420 0x00000040 # DDR Extended Mode +# bit0: 0, DDR DLL enabled +# bit1: 0, DDR drive strenght normal +# bit2: 0, DDR ODT control lsd (disabled) +# bit5-3: 000, required +# bit6: 1, DDR ODT control msb, (disabled) +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required + +DATA 0xFFD01424 0x0000F17F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 0 +# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz +# bit9 : 0 , no half clock cycle addition to dataout +# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals +# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh +# bit15-12: 1111 required +# bit31-16: 0 required + +DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) +DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) + +DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 +DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size +# bit0: 1, Window enabled +# bit1: 0, Write Protect disabled +# bit3-2: 00, CS0 hit selected +# bit23-4: ones, required +# bit31-24: 0x0F, Size (i.e. 256MB) + +DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb +DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 + +DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled +DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled + +DATA 0xFFD01494 0x00030000 # DDR ODT Control (Low) +DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) +# bit1-0: 00, ODT0 controlled by ODT Control (low) register above +# bit3-2: 01, ODT1 active NEVER! +# bit31-4: zero, required + +DATA 0xFFD0149C 0x0000E803 # CPU ODT Control +DATA 0xFFD01480 0x00000001 # DDR Initialization Control +#bit0=1, enable DDR init upon this register write + +# End of Header extension +DATA 0x0 0x0 diff --git a/boards.cfg b/boards.cfg index 8a5bfc1..cceda57 100644 --- a/boards.cfg +++ b/boards.cfg @@ -135,6 +135,7 @@ portl2 arm arm926ejs km_arm keymile inetspace_v2 arm arm926ejs netspace_v2 LaCie kirkwood netspace_v2:INETSPACE_V2 netspace_v2 arm arm926ejs netspace_v2 LaCie kirkwood netspace_v2:NETSPACE_V2 netspace_max_v2 arm arm926ejs netspace_v2 LaCie kirkwood netspace_v2:NETSPACE_MAX_V2 +dreamplug arm arm926ejs - Marvell kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..0f2f9a2 --- /dev/null +++ b/include/configs/dreamplug.h @@ -0,0 +1,151 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 _CONFIG_DREAMPLUG_H +#define _CONFIG_DREAMPLUG_H + +/* + * FIXME: This belongs in mach-types.h. However, we only pull mach-types + * from Linus' kernel.org tree. This hasn't been updated primarily due to + * the recent arch/arm reshuffling. So, in the meantime, we'll place it + * here. + */ +#include <asm/mach-types.h> +#ifdef MACH_TYPE_DREAMPLUG +#error "MACH_TYPE_DREAMPLUG has been defined properly, please remove this." +#else +#define MACH_TYPE_DREAMPLUG 3550 +#endif + +/* + * Version number information + */ +#define CONFIG_IDENT_STRING "\nMarvell-DreamPlug" + +/* + * High Level Configuration Options (easy to change) + */ +#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_TYPE MACH_TYPE_DREAMPLUG +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* + * Commands configuration + */ +#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#include <config_cmd_default.h> +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ENV +#define CONFIG_CMD_FAT +#define CONFIG_CMD_SF +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_CMD_IDE +#define CONFIG_CMD_DATE + +/* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros + */ +#include "mv-common.h" + +/* + * Environment variables configurations + */ +#ifdef CONFIG_SPI_FLASH +#define CONFIG_ENV_IS_IN_SPI_FLASH 1 +#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64k */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif + +#ifdef CONFIG_CMD_SF +#define CONFIG_SPI_FLASH 1 +#define CONFIG_HARD_SPI 1 +#define CONFIG_KIRKWOOD_SPI 1 +#define CONFIG_SPI_FLASH_MACRONIX 1 +#define CONFIG_ENV_SPI_BUS 0 +#define CONFIG_ENV_SPI_CS 0 +#define CONFIG_ENV_SPI_MAX_HZ 50000000 /* 50 MHz */ +#endif + +/* + * max 4k env size is enough, but in case of nand + * it has to be rounded to sector size + */ +#define CONFIG_ENV_SIZE 0x1000 /* 4k */ +#define CONFIG_ENV_ADDR 0x100000 +#define CONFIG_ENV_OFFSET 0x100000 /* env starts here */ + +/* + * Default environment variables + */ +#define CONFIG_BOOTCOMMAND "setenv ethact egiga0; " \ + "${x_bootcmd_ethernet}; setenv ethact egiga1; " \ + "${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; "\ + "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ + "bootm 0x6400000;" + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "x_bootcmd_ethernet=ping 192.168.2.1\0" \ + "x_bootcmd_usb=usb start\0" \ + "x_bootcmd_kernel=fatload usb 0 0x6400000 uImage\0" \ + "x_bootargs=console=ttyS0,115200\0" \ + "x_bootargs_root=root=/dev/sda2 rootdelay=10\0" + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +#define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +#define CONFIG_PHY_BASE_ADR 0 +#endif /* CONFIG_CMD_NET */ + +/* + * SATA Driver configuration + */ +#ifdef CONFIG_MVSATA_IDE +#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET +#endif /*CONFIG_MVSATA_IDE*/ + +/* + * RTC driver configuration + */ +#ifdef CONFIG_CMD_DATE +#define CONFIG_RTC_MV +#endif /* CONFIG_CMD_DATE */ + +#define CONFIG_SYS_ALT_MEMTEST + +/* + * display enhanced info about the cpu at boot. + */ +#define CONFIG_DISPLAY_CPUINFO + +#endif /* _CONFIG_DREAMPLUG_H */

-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Monday, September 19, 2011 12:37 AM To: wd@denx.de Cc: u-boot@lists.denx.de; albert.u.boot@aribaud.net; Prafulla Wadaskar; u-boot@lakedaemon.net Subject: [PATCH v8] dreamplug: initial board support.
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
CONFIG_MACH_DREAMPLUG defined in include/configs/dreamplug.h until Linus's kernel.org tree adds it to mach-types.h. Once it trickles down, the definition can be removed from include/configs/dreamplug.h.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
Changes from v1 to v2:
- resorted series to move 'make all' support last.
Changes from v2 to v3:
- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux. - Update MAINTAINERS. - Collapse into one patch.
Changes from v3 to v4:
- update copyright info as recommended by Prafulla Wadaskar. - maintain proper order in boards.cfg, MAINTAINERS, etc. - label MPP's - change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).
Changes from v4 to v5:
- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech. - Added driver for integrated RTC. (thx GST!) - Added support for displaying CPU frequencies at boot. (thx GST!) - Adjust USB timeout to handle dreamplug EHCI chipset. - Cleaned up MPP registers based on Global Scale code. (thx GST!) - broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to
use MACH_TYPE_DREAMPLUG.
Changes from v5 to v6:
- Define MACH_TYPE_DREAMPLUG in includes/configs/dreamplug.h until Linus's kernel.org tree includes assigned machine id. This is on Wolfgang's recommendation [1].
- Removed dcache disabling as it is no longer enabled by default.
- USB timeout fix was merged.
- Marvell Integrated RTC was merged.
- Dropped CPU frequency printout as I'm not familiar enough with all flavors of kirkwood SoCs to do it correctly.
- Labelled MPP*_GPIO pins that are broken out as gpio pins for the user.
- Fixed function name mv_phy_88e1121_init() ->
mv_phy_88e1116_init().
Changes from v6 to v7:
- Use CONFIG_MACH_TYPE in dreamplug.c and define it to MACH_TYPE_DREAMPLUG in include/configs/dreamplug.h
Changes from v7 to v8:
- #error MACH_TYPE_DREAMPLUG once it is defined in mach-types.h. On Albert Aribaud's recommendation.
[1] http://www.mail-archive.com/u-boot@lists.denx.de/msg60921.html
MAINTAINERS | 4 + board/Marvell/dreamplug/Makefile | 54 ++++++++ board/Marvell/dreamplug/dreamplug.c | 151 +++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 +++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 151 +++++++++++++++++++++++ 7 files changed, 566 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
Applied to u-boot-marvell.git master branch
Regards.. Prafulla . .

Signed-off-by: Jason Cooper u-boot@lakedaemon.net --- drivers/rtc/Makefile | 1 + drivers/rtc/mvinteg_rtc.c | 151 +++++++++++++++++++++++++++++++++++++++++++++ drivers/rtc/mvinteg_rtc.h | 89 ++++++++++++++++++++++++++ 3 files changed, 241 insertions(+), 0 deletions(-) create mode 100644 drivers/rtc/mvinteg_rtc.c create mode 100644 drivers/rtc/mvinteg_rtc.h
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index e4be4a4..ed63e9c 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -55,6 +55,7 @@ COBJS-$(CONFIG_MCFRTC) += mcfrtc.o COBJS-$(CONFIG_RTC_MK48T59) += mk48t59.o COBJS-$(CONFIG_RTC_MPC5200) += mpc5xxx.o COBJS-$(CONFIG_RTC_MPC8xx) += mpc8xx.o +COBJS-$(CONFIG_RTC_MVINTEG) += mvinteg_rtc.o COBJS-$(CONFIG_RTC_PCF8563) += pcf8563.o COBJS-$(CONFIG_RTC_PL031) += pl031.o COBJS-$(CONFIG_RTC_PT7C4338) += pt7c4338.o diff --git a/drivers/rtc/mvinteg_rtc.c b/drivers/rtc/mvinteg_rtc.c new file mode 100644 index 0000000..295e4f7 --- /dev/null +++ b/drivers/rtc/mvinteg_rtc.c @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * 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., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* + * Date & Time support for Marvell Integrated RTC + */ + +#include <common.h> +#include <command.h> +#include <rtc.h> +#include "mvinteg_rtc.h" + +/* This RTC does not support century, so we assume 20 */ +#define CENTURY 20 + +int rtc_get(struct rtc_time *t) +{ + u32 time; + u32 date; + u8 tens; + u8 single; + + /* read the time register */ + time = MV_REG_READ(MVINTEG_RTCTIME_REG); + + /* read the date register */ + date = MV_REG_READ(MVINTEG_RTCDATE_REG); + + /* seconds */ + tens = ((time & MVINTEG_10SEC_MSK) >> MVINTEG_10SEC_SFT); + single = ((time & MVINTEG_SEC_MSK) >> MVINTEG_SEC_SFT); + t->tm_sec = 10 * tens + single; + + /* minutes */ + tens = ((time & MVINTEG_10MIN_MSK) >> MVINTEG_10MIN_SFT); + single = ((time & MVINTEG_MIN_MSK) >> MVINTEG_MIN_SFT); + t->tm_min = 10 * tens + single; + + /* hours */ + tens = ((time & MVINTEG_10HOUR_MSK) >> MVINTEG_10HOUR_SFT); + single = ((time & MVINTEG_HOUR_MSK) >> MVINTEG_HOUR_SFT); + t->tm_hour = 10 * tens + single; + + /* day */ + t->tm_wday = ((time & MVINTEG_DAY_MSK) >> MVINTEG_DAY_SFT); + t->tm_wday--; + + /* date */ + tens = ((date & MVINTEG_10DATE_MSK) >> MVINTEG_10DATE_SFT); + single = ((date & MVINTEG_DATE_MSK) >> MVINTEG_DATE_SFT); + t->tm_mday = 10 * tens + single; + + /* month */ + tens = ((date & MVINTEG_10MON_MSK) >> MVINTEG_10MON_SFT); + single = ((date & MVINTEG_MON_MSK) >> MVINTEG_MON_SFT); + t->tm_mon = 10 * tens + single; + + /* year */ + tens = ((date & MVINTEG_10YEAR_MSK) >> MVINTEG_10YEAR_SFT); + single = ((date & MVINTEG_YEAR_MSK) >> MVINTEG_YEAR_SFT); + t->tm_year = (CENTURY * 100) + (10 * tens) + single; + + /* not supported in this RTC */ + t->tm_yday = 0; + t->tm_isdst = 0; + + return 0; +} + +int rtc_set(struct rtc_time *t) +{ + u32 time = 0; + u32 date = 0; + u32 tens; + u32 single; + + /* seconds */ + tens = t->tm_sec / 10; + single = t->tm_sec % 10; + time |= ((tens << MVINTEG_10SEC_SFT) & MVINTEG_10SEC_MSK) | + ((single << MVINTEG_SEC_SFT) & MVINTEG_SEC_MSK); + + /* minutes */ + tens = t->tm_min / 10; + single = t->tm_min % 10; + time |= ((tens << MVINTEG_10MIN_SFT) & MVINTEG_10MIN_MSK) | + ((single << MVINTEG_MIN_SFT) & MVINTEG_MIN_MSK); + + /* hours (24) */ + tens = t->tm_hour / 10; + single = t->tm_hour % 10; + time |= ((tens << MVINTEG_10HOUR_SFT) & MVINTEG_10HOUR_MSK) | + ((single << MVINTEG_HOUR_SFT) & MVINTEG_HOUR_MSK); + + /* day */ + single = t->tm_wday + 1; + time |= ((single << MVINTEG_DAY_SFT) & MVINTEG_DAY_MSK); + + /* date */ + tens = t->tm_mday / 10; + single = t->tm_mday % 10; + date |= ((tens << MVINTEG_10DATE_SFT) & MVINTEG_10DATE_MSK) | + ((single << MVINTEG_DATE_SFT) & MVINTEG_DATE_MSK); + + /* month */ + tens = t->tm_mon / 10; + single = t->tm_mon % 10; + date |= ((tens << MVINTEG_10MON_SFT) & MVINTEG_10MON_MSK) | + ((single << MVINTEG_MON_SFT) & MVINTEG_MON_MSK); + + /* year */ + if ((t->tm_year / 100) != CENTURY) + printf("Warning: Only century %d supported.\n", CENTURY); + tens = (t->tm_year % 100) / 10; + single = (t->tm_year % 100) % 10; + date |= ((tens << MVINTEG_10YEAR_SFT) & MVINTEG_10YEAR_MSK) | + ((single << MVINTEG_YEAR_SFT) & MVINTEG_YEAR_MSK); + + /* write the time register */ + MV_REG_WRITE(MVINTEG_RTCTIME_REG, time); + + /* write the date register */ + MV_REG_WRITE(MVINTEG_RTCDATE_REG, date); + + return 0; +} + +void rtc_reset(void) +{ + /* no init routine for this RTC needed */ +} diff --git a/drivers/rtc/mvinteg_rtc.h b/drivers/rtc/mvinteg_rtc.h new file mode 100644 index 0000000..522c5d0 --- /dev/null +++ b/drivers/rtc/mvinteg_rtc.h @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * 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., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* + * Date & Time support for Marvell Integrated RTC + */ + +#ifndef _MVINTEG_RTC_H_ +#define _MVINTEG_RTC_H_ + +#include <compiler.h> + +#define INTERNAL_REG_BASE_ADDR 0xf1000000 + +/* register operations macros */ +#define MV_REG_READ(offset) \ + le32_to_cpu( \ + *(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset)) + +#define MV_REG_WRITE(offset, data) \ + do { \ + *(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset) = \ + cpu_to_le32(data); \ + } while (0); + +/* RTC registers */ +#define MVINTEG_RTCTIME_REG 0x10300 +#define MVINTEG_RTCDATE_REG 0x10304 + +/* time register */ +#define MVINTEG_SEC_SFT 0 +#define MVINTEG_SEC_MSK (0xf << MVINTEG_SEC_SFT) +#define MVINTEG_10SEC_SFT 4 +#define MVINTEG_10SEC_MSK (0x7 << MVINTEG_10SEC_SFT) + +#define MVINTEG_MIN_SFT 8 +#define MVINTEG_MIN_MSK (0xf << MVINTEG_MIN_SFT) +#define MVINTEG_10MIN_SFT 12 +#define MVINTEG_10MIN_MSK (0x7 << MVINTEG_10MIN_SFT) + +#define MVINTEG_HOUR_SFT 16 +#define MVINTEG_HOUR_MSK (0xf << MVINTEG_HOUR_SFT) +#define MVINTEG_10HOUR_SFT 20 +#define MVINTEG_10HOUR_MSK (0x3 << MVINTEG_10HOUR_SFT) + +#define MVINTEG_HRFMT_SFT 22 +#define MVINTEG_HRFMT12_MSK (0x1 << MVINTEG_HRFMT_SFT) +#define MVINTEG_HRFMT24_MSK (0x0 << MVINTEG_HRFMT_SFT) + +#define MVINTEG_DAY_SFT 24 +#define MVINTEG_DAY_MSK (0x7 << MVINTEG_DAY_SFT) + +/* date register */ +#define MVINTEG_DATE_SFT 0 +#define MVINTEG_DATE_MSK (0xf << MVINTEG_DATE_SFT) +#define MVINTEG_10DATE_SFT 4 +#define MVINTEG_10DATE_MSK (0x3 << MVINTEG_10DATE_SFT) + +#define MVINTEG_MON_SFT 8 +#define MVINTEG_MON_MSK (0xf << MVINTEG_MON_SFT) +#define MVINTEG_10MON_SFT 12 +#define MVINTEG_10MON_MSK (0x1 << MVINTEG_10MON_SFT) + +#define MVINTEG_YEAR_SFT 16 +#define MVINTEG_YEAR_MSK (0xf << MVINTEG_YEAR_SFT) +#define MVINTEG_10YEAR_SFT 20 +#define MVINTEG_10YEAR_MSK (0xf << MVINTEG_10YEAR_SFT) + +#endif

-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
drivers/rtc/Makefile | 1 + drivers/rtc/mvinteg_rtc.c | 151
Filename mvrtc.c sounds more relevent
+++++++++++++++++++++++++++++++++++++++++++++ drivers/rtc/mvinteg_rtc.h | 89 ++++++++++++++++++++++++++ 3 files changed, 241 insertions(+), 0 deletions(-) create mode 100644 drivers/rtc/mvinteg_rtc.c create mode 100644 drivers/rtc/mvinteg_rtc.h
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index e4be4a4..ed63e9c 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -55,6 +55,7 @@ COBJS-$(CONFIG_MCFRTC) += mcfrtc.o COBJS-$(CONFIG_RTC_MK48T59) += mk48t59.o COBJS-$(CONFIG_RTC_MPC5200) += mpc5xxx.o COBJS-$(CONFIG_RTC_MPC8xx) += mpc8xx.o +COBJS-$(CONFIG_RTC_MVINTEG) += mvinteg_rtc.o COBJS-$(CONFIG_RTC_PCF8563) += pcf8563.o COBJS-$(CONFIG_RTC_PL031) += pl031.o COBJS-$(CONFIG_RTC_PT7C4338) += pt7c4338.o diff --git a/drivers/rtc/mvinteg_rtc.c b/drivers/rtc/mvinteg_rtc.c new file mode 100644 index 0000000..295e4f7 --- /dev/null +++ b/drivers/rtc/mvinteg_rtc.c @@ -0,0 +1,151 @@ +/*
- Copyright (C) 2011
- Jason Cooper u-boot@lakedaemon.net
- 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., 59 Temple Place, Suite 330, Boston,
- MA 02111-1307 USA
- */
+/*
- Date & Time support for Marvell Integrated RTC
- */
+#include <common.h> +#include <command.h> +#include <rtc.h> +#include "mvinteg_rtc.h"
+/* This RTC does not support century, so we assume 20 */ +#define CENTURY 20
+int rtc_get(struct rtc_time *t) +{
- u32 time;
- u32 date;
- u8 tens;
- u8 single;
- /* read the time register */
- time = MV_REG_READ(MVINTEG_RTCTIME_REG);
- /* read the date register */
- date = MV_REG_READ(MVINTEG_RTCDATE_REG);
- /* seconds */
- tens = ((time & MVINTEG_10SEC_MSK) >> MVINTEG_10SEC_SFT);
- single = ((time & MVINTEG_SEC_MSK) >> MVINTEG_SEC_SFT);
- t->tm_sec = 10 * tens + single;
- /* minutes */
- tens = ((time & MVINTEG_10MIN_MSK) >> MVINTEG_10MIN_SFT);
- single = ((time & MVINTEG_MIN_MSK) >> MVINTEG_MIN_SFT);
- t->tm_min = 10 * tens + single;
- /* hours */
- tens = ((time & MVINTEG_10HOUR_MSK) >> MVINTEG_10HOUR_SFT);
- single = ((time & MVINTEG_HOUR_MSK) >> MVINTEG_HOUR_SFT);
- t->tm_hour = 10 * tens + single;
- /* day */
- t->tm_wday = ((time & MVINTEG_DAY_MSK) >> MVINTEG_DAY_SFT);
- t->tm_wday--;
- /* date */
- tens = ((date & MVINTEG_10DATE_MSK) >> MVINTEG_10DATE_SFT);
- single = ((date & MVINTEG_DATE_MSK) >> MVINTEG_DATE_SFT);
- t->tm_mday = 10 * tens + single;
- /* month */
- tens = ((date & MVINTEG_10MON_MSK) >> MVINTEG_10MON_SFT);
- single = ((date & MVINTEG_MON_MSK) >> MVINTEG_MON_SFT);
- t->tm_mon = 10 * tens + single;
- /* year */
- tens = ((date & MVINTEG_10YEAR_MSK) >> MVINTEG_10YEAR_SFT);
- single = ((date & MVINTEG_YEAR_MSK) >> MVINTEG_YEAR_SFT);
- t->tm_year = (CENTURY * 100) + (10 * tens) + single;
- /* not supported in this RTC */
- t->tm_yday = 0;
- t->tm_isdst = 0;
- return 0;
+}
+int rtc_set(struct rtc_time *t) +{
- u32 time = 0;
- u32 date = 0;
- u32 tens;
- u32 single;
- /* seconds */
- tens = t->tm_sec / 10;
- single = t->tm_sec % 10;
- time |= ((tens << MVINTEG_10SEC_SFT) & MVINTEG_10SEC_MSK) |
((single << MVINTEG_SEC_SFT) & MVINTEG_SEC_MSK);
- /* minutes */
- tens = t->tm_min / 10;
- single = t->tm_min % 10;
- time |= ((tens << MVINTEG_10MIN_SFT) & MVINTEG_10MIN_MSK) |
((single << MVINTEG_MIN_SFT) & MVINTEG_MIN_MSK);
- /* hours (24) */
- tens = t->tm_hour / 10;
- single = t->tm_hour % 10;
- time |= ((tens << MVINTEG_10HOUR_SFT) & MVINTEG_10HOUR_MSK) |
((single << MVINTEG_HOUR_SFT) & MVINTEG_HOUR_MSK);
- /* day */
- single = t->tm_wday + 1;
- time |= ((single << MVINTEG_DAY_SFT) & MVINTEG_DAY_MSK);
- /* date */
- tens = t->tm_mday / 10;
- single = t->tm_mday % 10;
- date |= ((tens << MVINTEG_10DATE_SFT) & MVINTEG_10DATE_MSK) |
((single << MVINTEG_DATE_SFT) & MVINTEG_DATE_MSK);
- /* month */
- tens = t->tm_mon / 10;
- single = t->tm_mon % 10;
- date |= ((tens << MVINTEG_10MON_SFT) & MVINTEG_10MON_MSK) |
((single << MVINTEG_MON_SFT) & MVINTEG_MON_MSK);
- /* year */
- if ((t->tm_year / 100) != CENTURY)
printf("Warning: Only century %d supported.\n", CENTURY);
- tens = (t->tm_year % 100) / 10;
- single = (t->tm_year % 100) % 10;
- date |= ((tens << MVINTEG_10YEAR_SFT) & MVINTEG_10YEAR_MSK) |
((single << MVINTEG_YEAR_SFT) & MVINTEG_YEAR_MSK);
- /* write the time register */
- MV_REG_WRITE(MVINTEG_RTCTIME_REG, time);
- /* write the date register */
- MV_REG_WRITE(MVINTEG_RTCDATE_REG, date);
- return 0;
+}
+void rtc_reset(void) +{
- /* no init routine for this RTC needed */
+} diff --git a/drivers/rtc/mvinteg_rtc.h b/drivers/rtc/mvinteg_rtc.h new file mode 100644 index 0000000..522c5d0 --- /dev/null +++ b/drivers/rtc/mvinteg_rtc.h @@ -0,0 +1,89 @@ +/*
- Copyright (C) 2011
- Jason Cooper u-boot@lakedaemon.net
- 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., 59 Temple Place, Suite 330, Boston,
- MA 02111-1307 USA
- */
+/*
- Date & Time support for Marvell Integrated RTC
- */
+#ifndef _MVINTEG_RTC_H_ +#define _MVINTEG_RTC_H_
+#include <compiler.h>
+#define INTERNAL_REG_BASE_ADDR 0xf1000000
This must go in kirkood.h
+/* register operations macros */ +#define MV_REG_READ(offset) \
- le32_to_cpu( \
- *(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset))
+#define MV_REG_WRITE(offset, data) \
- do { \
*(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset) = \
cpu_to_le32(data); \
- } while (0);
+/* RTC registers */ +#define MVINTEG_RTCTIME_REG 0x10300 +#define MVINTEG_RTCDATE_REG 0x10304
NAK, please use c-strut for register definations
+/* time register */ +#define MVINTEG_SEC_SFT 0 +#define MVINTEG_SEC_MSK (0xf << MVINTEG_SEC_SFT) +#define MVINTEG_10SEC_SFT 4 +#define MVINTEG_10SEC_MSK (0x7 << MVINTEG_10SEC_SFT)
+#define MVINTEG_MIN_SFT 8 +#define MVINTEG_MIN_MSK (0xf << MVINTEG_MIN_SFT) +#define MVINTEG_10MIN_SFT 12 +#define MVINTEG_10MIN_MSK (0x7 << MVINTEG_10MIN_SFT)
+#define MVINTEG_HOUR_SFT 16 +#define MVINTEG_HOUR_MSK (0xf << MVINTEG_HOUR_SFT) +#define MVINTEG_10HOUR_SFT 20 +#define MVINTEG_10HOUR_MSK (0x3 << MVINTEG_10HOUR_SFT)
+#define MVINTEG_HRFMT_SFT 22 +#define MVINTEG_HRFMT12_MSK (0x1 << MVINTEG_HRFMT_SFT) +#define MVINTEG_HRFMT24_MSK (0x0 << MVINTEG_HRFMT_SFT)
+#define MVINTEG_DAY_SFT 24 +#define MVINTEG_DAY_MSK (0x7 << MVINTEG_DAY_SFT)
+/* date register */ +#define MVINTEG_DATE_SFT 0 +#define MVINTEG_DATE_MSK (0xf << MVINTEG_DATE_SFT) +#define MVINTEG_10DATE_SFT 4 +#define MVINTEG_10DATE_MSK (0x3 << MVINTEG_10DATE_SFT)
+#define MVINTEG_MON_SFT 8 +#define MVINTEG_MON_MSK (0xf << MVINTEG_MON_SFT) +#define MVINTEG_10MON_SFT 12 +#define MVINTEG_10MON_MSK (0x1 << MVINTEG_10MON_SFT)
+#define MVINTEG_YEAR_SFT 16 +#define MVINTEG_YEAR_MSK (0xf << MVINTEG_YEAR_SFT) +#define MVINTEG_10YEAR_SFT 20 +#define MVINTEG_10YEAR_MSK (0xf << MVINTEG_10YEAR_SFT)
+#endif
Regards.. Prafulla . .
1.7.0.4

On Wed, Jul 27, 2011 at 11:12:35AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
drivers/rtc/Makefile | 1 + drivers/rtc/mvinteg_rtc.c | 151
Filename mvrtc.c sounds more relevent
Will do.
...
+#define INTERNAL_REG_BASE_ADDR 0xf1000000
This must go in kirkood.h
Thanks. That didn't feel right to me, but I didn't know the proper place to put it.
...
+/* register operations macros */ +#define MV_REG_READ(offset) \
- le32_to_cpu( \
- *(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset))
+#define MV_REG_WRITE(offset, data) \
- do { \
*(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset) = \
cpu_to_le32(data); \
- } while (0);
+/* RTC registers */ +#define MVINTEG_RTCTIME_REG 0x10300 +#define MVINTEG_RTCDATE_REG 0x10304
NAK, please use c-strut for register definations
So then, in kirkwood.h:
#define KW_RTC_BASE (KW_REGISTER(0x10300))
and then use accordingly:
struct mvrtc_registers { u32 time; u32 date; };
struct mvrtc_registers *mvrtc_regs = (struct mvrtc_registers *)KW_RTC_BASE;
Right? I'm basing this on kirkwood/timer.c
...
Regards.. Prafulla . .
As always, thanks for the review and comments.
thx,
Jason.

-----Original Message----- From: Jason [mailto:twuug@lakedaemon.net] Sent: Thursday, July 28, 2011 6:52 AM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.
On Wed, Jul 27, 2011 at 11:12:35AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;
Siddarth
Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 1/5] drivers/rtc: add Marvell Integrated RTC.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
drivers/rtc/Makefile | 1 + drivers/rtc/mvinteg_rtc.c | 151
Filename mvrtc.c sounds more relevent
Will do.
...
+#define INTERNAL_REG_BASE_ADDR 0xf1000000
This must go in kirkood.h
Thanks. That didn't feel right to me, but I didn't know the proper place to put it.
...
+/* register operations macros */ +#define MV_REG_READ(offset) \
- le32_to_cpu( \
- *(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset))
+#define MV_REG_WRITE(offset, data) \
- do { \
*(volatile unsigned int *)(INTERNAL_REG_BASE_ADDR + offset)
= \
cpu_to_le32(data); \
- } while (0);
+/* RTC registers */ +#define MVINTEG_RTCTIME_REG 0x10300 +#define MVINTEG_RTCDATE_REG 0x10304
NAK, please use c-strut for register definations
So then, in kirkwood.h:
#define KW_RTC_BASE (KW_REGISTER(0x10300))
and then use accordingly:
struct mvrtc_registers { u32 time; u32 date; };
struct mvrtc_registers *mvrtc_regs = (struct mvrtc_registers *)KW_RTC_BASE;
Right? I'm basing this on kirkwood/timer.c
That's perfect :-)
...
Regards.. Prafulla . .
As always, thanks for the review and comments.
That's my pleasure too.
Regards.. Prafulla . .

Signed-off-by: Jason Cooper u-boot@lakedaemon.net --- arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 46 ++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-kirkwood/cpu.h | 1 + 2 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c index b4a4c04..a69f9f2 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c @@ -270,11 +270,26 @@ static void kw_sysrst_check(void) }
#if defined(CONFIG_DISPLAY_CPUINFO) +#define MSAR_CPUCLCK_EXTRACT(X) (((X & 0x2) >> 1) | ((X & 0x400000) >> 21) | \ + ((X & 0x18) >> 1)) +#define MSAR_L2CLCK_EXTRACT(X) (((X & 0x600) >> 9) | ((X & 0x80000) >> 17)) +#define MSAR_DDRCLCK_RTIO_MASK (0xf << 5) + +#define MSAR_TCLCK_OFFS 21 +#define MSAR_TCLCK_MASK (0x1 << MSAR_TCLCK_OFFS) +#define MV_BOARD_TCLK_166MHZ 166666667 +#define MV_BOARD_TCLK_200MHZ 200000000 +#define MSAR_TCLCK_167 (0x1 << MSAR_TCLCK_OFFS) +#define MSAR_TCLCK_200 (0x0 << MSAR_TCLCK_OFFS) + int print_cpuinfo(void) { char *rev; u16 devid = (readl(KW_REG_PCIE_DEVID) >> 16) & 0xffff; u8 revid = readl(KW_REG_PCIE_REVID) & 0xff; + u32 cpu_clk, t_clk, tmp; + u32 sys_clk, l2_clk; + u32 l2_ratio, ddr_ratio;
if ((readl(KW_REG_DEVICE_ID) & 0x03) > 2) { printf("Error.. %s:Unsupported Kirkwood SoC 88F%04x\n", __FUNCTION__, devid); @@ -297,6 +312,37 @@ int print_cpuinfo(void) }
printf("SoC: Kirkwood 88F%04x_%s\n", devid, rev); + + tmp = readl(MPP_SAMPLE_AT_RESET); + cpu_clk = MSAR_CPUCLCK_EXTRACT(tmp); + if (cpu_clk == 0x9) + cpu_clk = 1200; + + l2_ratio = MSAR_L2CLCK_EXTRACT(tmp); + l2_clk = cpu_clk / l2_ratio; + + ddr_ratio = tmp & MSAR_DDRCLCK_RTIO_MASK; + ddr_ratio = ddr_ratio >> 5; + if (ddr_ratio == 4) + sys_clk = 400; + + switch (tmp & MSAR_TCLCK_MASK) { + case MSAR_TCLCK_167: + t_clk = MV_BOARD_TCLK_166MHZ; + break; + case MSAR_TCLCK_200: + t_clk = MV_BOARD_TCLK_200MHZ; + break; + default: + t_clk = MV_BOARD_TCLK_200MHZ; + break; + } + + printf("CPU running @ %dMHz L2 running @ %dMHz\n", + cpu_clk, l2_clk); + printf("SysClock = %dMHz, TClock = %dMHz\n", + sys_clk, t_clk / 1000000); + return 0; } #endif /* CONFIG_DISPLAY_CPUINFO */ diff --git a/arch/arm/include/asm/arch-kirkwood/cpu.h b/arch/arm/include/asm/arch-kirkwood/cpu.h index d28c51a..28ddd25 100644 --- a/arch/arm/include/asm/arch-kirkwood/cpu.h +++ b/arch/arm/include/asm/arch-kirkwood/cpu.h @@ -41,6 +41,7 @@ #define KW_REG_SYSRST_CNT (KW_MPP_BASE + 0x50) #define SYSRST_CNT_1SEC_VAL (25*1000000) #define KW_REG_MPP_OUT_DRV_REG (KW_MPP_BASE + 0xE0) +#define MPP_SAMPLE_AT_RESET (KW_MPP_BASE + 0x30)
enum memory_bank { BANK0,

-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 46 ++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-kirkwood/cpu.h | 1 + 2 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c index b4a4c04..a69f9f2 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c @@ -270,11 +270,26 @@ static void kw_sysrst_check(void) }
#if defined(CONFIG_DISPLAY_CPUINFO) +#define MSAR_CPUCLCK_EXTRACT(X) (((X & 0x2) >> 1) | ((X & 0x400000) >> 21) | \
((X & 0x18) >> 1))
+#define MSAR_L2CLCK_EXTRACT(X) (((X & 0x600) >> 9) | ((X & 0x80000) >> 17)) +#define MSAR_DDRCLCK_RTIO_MASK (0xf << 5)
+#define MSAR_TCLCK_OFFS 21 +#define MSAR_TCLCK_MASK (0x1 << MSAR_TCLCK_OFFS) +#define MV_BOARD_TCLK_166MHZ 166666667 +#define MV_BOARD_TCLK_200MHZ 200000000 +#define MSAR_TCLCK_167 (0x1 << MSAR_TCLCK_OFFS) +#define MSAR_TCLCK_200 (0x0 << MSAR_TCLCK_OFFS)
There are one time used macros, can they be optimized?
int print_cpuinfo(void) { char *rev; u16 devid = (readl(KW_REG_PCIE_DEVID) >> 16) & 0xffff; u8 revid = readl(KW_REG_PCIE_REVID) & 0xff;
u32 cpu_clk, t_clk, tmp;
u32 sys_clk, l2_clk;
u32 l2_ratio, ddr_ratio;
if ((readl(KW_REG_DEVICE_ID) & 0x03) > 2) { printf("Error.. %s:Unsupported Kirkwood SoC 88F%04x\n",
__FUNCTION__, devid); @@ -297,6 +312,37 @@ int print_cpuinfo(void) }
printf("SoC: Kirkwood 88F%04x_%s\n", devid, rev);
- tmp = readl(MPP_SAMPLE_AT_RESET);
- cpu_clk = MSAR_CPUCLCK_EXTRACT(tmp);
- if (cpu_clk == 0x9)
cpu_clk = 1200;
- l2_ratio = MSAR_L2CLCK_EXTRACT(tmp);
- l2_clk = cpu_clk / l2_ratio;
- ddr_ratio = tmp & MSAR_DDRCLCK_RTIO_MASK;
- ddr_ratio = ddr_ratio >> 5;
- if (ddr_ratio == 4)
sys_clk = 400;
- switch (tmp & MSAR_TCLCK_MASK) {
- case MSAR_TCLCK_167:
t_clk = MV_BOARD_TCLK_166MHZ;
break;
- case MSAR_TCLCK_200:
t_clk = MV_BOARD_TCLK_200MHZ;
break;
- default:
t_clk = MV_BOARD_TCLK_200MHZ;
break;
- }
- printf("CPU running @ %dMHz L2 running @ %dMHz\n",
cpu_clk, l2_clk);
- printf("SysClock = %dMHz, TClock = %dMHz\n",
sys_clk, t_clk / 1000000);
It is good to encapsulate this in #ifdef CONFIG_SYS_XXX
- return 0;
} #endif /* CONFIG_DISPLAY_CPUINFO */ diff --git a/arch/arm/include/asm/arch-kirkwood/cpu.h b/arch/arm/include/asm/arch-kirkwood/cpu.h index d28c51a..28ddd25 100644 --- a/arch/arm/include/asm/arch-kirkwood/cpu.h +++ b/arch/arm/include/asm/arch-kirkwood/cpu.h @@ -41,6 +41,7 @@ #define KW_REG_SYSRST_CNT (KW_MPP_BASE + 0x50) #define SYSRST_CNT_1SEC_VAL (25*1000000) #define KW_REG_MPP_OUT_DRV_REG (KW_MPP_BASE + 0xE0) +#define MPP_SAMPLE_AT_RESET (KW_MPP_BASE + 0x30)
enum memory_bank { BANK0, --
Regards.. Prafulla . .
1.7.0.4

On Wed, Jul 27, 2011 at 11:21:16AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 46 ++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-kirkwood/cpu.h | 1 + 2 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c index b4a4c04..a69f9f2 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c @@ -270,11 +270,26 @@ static void kw_sysrst_check(void) }
#if defined(CONFIG_DISPLAY_CPUINFO) +#define MSAR_CPUCLCK_EXTRACT(X) (((X & 0x2) >> 1) | ((X & 0x400000) >> 21) | \
((X & 0x18) >> 1))
+#define MSAR_L2CLCK_EXTRACT(X) (((X & 0x600) >> 9) | ((X & 0x80000) >> 17)) +#define MSAR_DDRCLCK_RTIO_MASK (0xf << 5)
+#define MSAR_TCLCK_OFFS 21 +#define MSAR_TCLCK_MASK (0x1 << MSAR_TCLCK_OFFS) +#define MV_BOARD_TCLK_166MHZ 166666667 +#define MV_BOARD_TCLK_200MHZ 200000000 +#define MSAR_TCLCK_167 (0x1 << MSAR_TCLCK_OFFS) +#define MSAR_TCLCK_200 (0x0 << MSAR_TCLCK_OFFS)
There are one time used macros, can they be optimized?
Sure, do you prefer a static assignment:
#define MSAR_TCLCK_166 0x00200000
or, just do away with it altogether and use the number?
int print_cpuinfo(void) { char *rev; u16 devid = (readl(KW_REG_PCIE_DEVID) >> 16) & 0xffff; u8 revid = readl(KW_REG_PCIE_REVID) & 0xff;
u32 cpu_clk, t_clk, tmp;
u32 sys_clk, l2_clk;
u32 l2_ratio, ddr_ratio;
if ((readl(KW_REG_DEVICE_ID) & 0x03) > 2) { printf("Error.. %s:Unsupported Kirkwood SoC 88F%04x\n",
__FUNCTION__, devid); @@ -297,6 +312,37 @@ int print_cpuinfo(void) }
printf("SoC: Kirkwood 88F%04x_%s\n", devid, rev);
- tmp = readl(MPP_SAMPLE_AT_RESET);
- cpu_clk = MSAR_CPUCLCK_EXTRACT(tmp);
- if (cpu_clk == 0x9)
cpu_clk = 1200;
- l2_ratio = MSAR_L2CLCK_EXTRACT(tmp);
- l2_clk = cpu_clk / l2_ratio;
- ddr_ratio = tmp & MSAR_DDRCLCK_RTIO_MASK;
- ddr_ratio = ddr_ratio >> 5;
- if (ddr_ratio == 4)
sys_clk = 400;
- switch (tmp & MSAR_TCLCK_MASK) {
- case MSAR_TCLCK_167:
t_clk = MV_BOARD_TCLK_166MHZ;
break;
- case MSAR_TCLCK_200:
t_clk = MV_BOARD_TCLK_200MHZ;
break;
- default:
t_clk = MV_BOARD_TCLK_200MHZ;
break;
- }
- printf("CPU running @ %dMHz L2 running @ %dMHz\n",
cpu_clk, l2_clk);
- printf("SysClock = %dMHz, TClock = %dMHz\n",
sys_clk, t_clk / 1000000);
It is good to encapsulate this in #ifdef CONFIG_SYS_XXX
It's already encapsulated in CONFIG_DISPLAY_CPUINFO, so if enabled, on boot it looks like:
SoC: Kirkwood 88F6281_A1 CPU running @ 1200MHz L2 running @ 400MHz SysClock = 400MHz, TClock = 200MHz
I can encapsulate it separately if you want, but it seems a little too fine grained for me. Either I want cpu info, or I don't. ymmv.
thx,
Jason.

-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Thursday, July 28, 2011 7:02 AM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.
On Wed, Jul 27, 2011 at 11:21:16AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;
Siddarth
Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 2/5] arm/kirkwood: print speeds with cpu info.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 46 ++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-kirkwood/cpu.h | 1 + 2 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c index b4a4c04..a69f9f2 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/cpu.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/cpu.c @@ -270,11 +270,26 @@ static void kw_sysrst_check(void) }
#if defined(CONFIG_DISPLAY_CPUINFO) +#define MSAR_CPUCLCK_EXTRACT(X) (((X & 0x2) >> 1) | ((X &
0x400000) >>
- | \
((X & 0x18) >> 1))
+#define MSAR_L2CLCK_EXTRACT(X) (((X & 0x600) >> 9) | ((X &
0x80000) >>
17)) +#define MSAR_DDRCLCK_RTIO_MASK (0xf << 5)
+#define MSAR_TCLCK_OFFS 21 +#define MSAR_TCLCK_MASK (0x1 << MSAR_TCLCK_OFFS) +#define MV_BOARD_TCLK_166MHZ 166666667 +#define MV_BOARD_TCLK_200MHZ 200000000 +#define MSAR_TCLCK_167 (0x1 << MSAR_TCLCK_OFFS) +#define MSAR_TCLCK_200 (0x0 << MSAR_TCLCK_OFFS)
There are one time used macros, can they be optimized?
Sure, do you prefer a static assignment:
#define MSAR_TCLCK_166 0x00200000
This is okay with some comments.
or, just do away with it altogether and use the number?
int print_cpuinfo(void) { char *rev; u16 devid = (readl(KW_REG_PCIE_DEVID) >> 16) & 0xffff; u8 revid = readl(KW_REG_PCIE_REVID) & 0xff;
u32 cpu_clk, t_clk, tmp;
u32 sys_clk, l2_clk;
u32 l2_ratio, ddr_ratio;
if ((readl(KW_REG_DEVICE_ID) & 0x03) > 2) { printf("Error.. %s:Unsupported Kirkwood SoC 88F%04x\n",
__FUNCTION__, devid); @@ -297,6 +312,37 @@ int print_cpuinfo(void) }
printf("SoC: Kirkwood 88F%04x_%s\n", devid, rev);
- tmp = readl(MPP_SAMPLE_AT_RESET);
- cpu_clk = MSAR_CPUCLCK_EXTRACT(tmp);
- if (cpu_clk == 0x9)
cpu_clk = 1200;
- l2_ratio = MSAR_L2CLCK_EXTRACT(tmp);
- l2_clk = cpu_clk / l2_ratio;
- ddr_ratio = tmp & MSAR_DDRCLCK_RTIO_MASK;
- ddr_ratio = ddr_ratio >> 5;
- if (ddr_ratio == 4)
sys_clk = 400;
- switch (tmp & MSAR_TCLCK_MASK) {
- case MSAR_TCLCK_167:
t_clk = MV_BOARD_TCLK_166MHZ;
break;
- case MSAR_TCLCK_200:
t_clk = MV_BOARD_TCLK_200MHZ;
break;
- default:
t_clk = MV_BOARD_TCLK_200MHZ;
break;
- }
- printf("CPU running @ %dMHz L2 running @ %dMHz\n",
cpu_clk, l2_clk);
- printf("SysClock = %dMHz, TClock = %dMHz\n",
sys_clk, t_clk / 1000000);
It is good to encapsulate this in #ifdef CONFIG_SYS_XXX
It's already encapsulated in CONFIG_DISPLAY_CPUINFO, so if enabled, on boot it looks like:
SoC: Kirkwood 88F6281_A1 CPU running @ 1200MHz L2 running @ 400MHz SysClock = 400MHz, TClock = 200MHz
I can encapsulate it separately if you want, but it seems a little too fine grained for me. Either I want cpu info, or I don't. ymmv.
I think you are right, this should be okay, anyway it displays useful information. Sorry for this noisy comments.
Regards.. Prafulla . .

Dear Jason Cooper,
In message 1311715171-13128-2-git-send-email-u-boot@lakedaemon.net you wrote:
...
- printf("CPU running @ %dMHz L2 running @ %dMHz\n",
cpu_clk, l2_clk);
- printf("SysClock = %dMHz, TClock = %dMHz\n",
sys_clk, t_clk / 1000000);
Please use strmhz() to format the frequencies.
Best regards,
Wolfgang Denk

Wolfgang,
On Thu, Oct 06, 2011 at 08:13:36PM +0200, Wolfgang Denk wrote:
In message 1311715171-13128-2-git-send-email-u-boot@lakedaemon.net you wrote: ...
- printf("CPU running @ %dMHz L2 running @ %dMHz\n",
cpu_clk, l2_clk);
- printf("SysClock = %dMHz, TClock = %dMHz\n",
sys_clk, t_clk / 1000000);
Please use strmhz() to format the frequencies.
Will do, however, please be aware that this patch has been set aside. I not familiar enough with all the variants to do it properly, and it was purely informative.
If somebody expresses an interest, or offers to help, I'll resume work on it at a later date.
thx,
Jason.

This fixes 'EHCI timed out on TD...' on the dreamplug board.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net --- include/usb.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/usb.h b/include/usb.h index 53603a5..168e2b2 100644 --- a/include/usb.h +++ b/include/usb.h @@ -46,7 +46,7 @@ * This is the timeout to allow for submitting an urb in ms. We allow more * time for a BULK device to react - some are slow. */ -#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100) +#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)
/* device request (setup) */ struct devrequest {

-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.
This fixes 'EHCI timed out on TD...' on the dreamplug board.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
include/usb.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/usb.h b/include/usb.h index 53603a5..168e2b2 100644 --- a/include/usb.h +++ b/include/usb.h @@ -46,7 +46,7 @@
- This is the timeout to allow for submitting an urb in ms. We allow
more
- time for a BULK device to react - some are slow.
*/ -#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100) +#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)
This looks global change, how will it affect other implementations?
Regards.. Prafulla . .

On Wed, Jul 27, 2011 at 11:23:50AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.
This fixes 'EHCI timed out on TD...' on the dreamplug board.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
include/usb.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/usb.h b/include/usb.h index 53603a5..168e2b2 100644 --- a/include/usb.h +++ b/include/usb.h @@ -46,7 +46,7 @@
- This is the timeout to allow for submitting an urb in ms. We allow
more
- time for a BULK device to react - some are slow.
*/ -#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100) +#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)
This looks global change, how will it affect other implementations?
I dunno, that's why it's RFC. ;-) It's a timeout, so it *shouldn't* adversely affect other systems with well behaved usb chipsets. And boards will ill-tempered usb chipsets should work better. But I'm not familiar enough with the usb code to say that definitively.
I could try doing a dreamplug-specific hack to make it work, but if there's no adverse affect to other systems, then this is a cleaner approach.
thx,
Jason.

-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Thursday, July 28, 2011 7:07 AM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.
On Wed, Jul 27, 2011 at 11:23:50AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;
Siddarth
Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to
respond.
This fixes 'EHCI timed out on TD...' on the dreamplug board.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
include/usb.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/usb.h b/include/usb.h index 53603a5..168e2b2 100644 --- a/include/usb.h +++ b/include/usb.h @@ -46,7 +46,7 @@
- This is the timeout to allow for submitting an urb in ms. We
allow
more
- time for a BULK device to react - some are slow.
*/ -#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100) +#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)
This looks global change, how will it affect other implementations?
I dunno, that's why it's RFC. ;-) It's a timeout, so it *shouldn't* adversely affect other systems with well behaved usb chipsets. And boards will ill-tempered usb chipsets should work better. But I'm not familiar enough with the usb code to say that definitively.
I could try doing a dreamplug-specific hack to make it work, but if there's no adverse affect to other systems, then this is a cleaner approach.
You can post this standalone patch, remove from this patch series since it will be acked/applied by other custodian.
Regards.. Prafulla . .

On Thu, Jul 28, 2011 at 12:16:00PM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Thursday, July 28, 2011 7:07 AM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to respond.
On Wed, Jul 27, 2011 at 11:23:50AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;
Siddarth
Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 3/5] usb: Some EHCI chipsets are slow to
respond.
This fixes 'EHCI timed out on TD...' on the dreamplug board.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
include/usb.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/usb.h b/include/usb.h index 53603a5..168e2b2 100644 --- a/include/usb.h +++ b/include/usb.h @@ -46,7 +46,7 @@
- This is the timeout to allow for submitting an urb in ms. We
allow
more
- time for a BULK device to react - some are slow.
*/ -#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100) +#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500)
This looks global change, how will it affect other implementations?
I dunno, that's why it's RFC. ;-) It's a timeout, so it *shouldn't* adversely affect other systems with well behaved usb chipsets. And boards will ill-tempered usb chipsets should work better. But I'm not familiar enough with the usb code to say that definitively.
I could try doing a dreamplug-specific hack to make it work, but if there's no adverse affect to other systems, then this is a cleaner approach.
You can post this standalone patch, remove from this patch series since it will be acked/applied by other custodian.
Based on new info (the OpenRD-ultimate is experiencing the same bug), a git bisect has revealed the following patch as the culprit:
commit c2dd0d45540397704de9b13287417d21049d34c6 Author: Aneesh V aneesh@ti.com Date: Thu Jun 16 23:30:49 2011 +0000
armv7: integrate cache maintenance support
- Enable I-cache on bootup - Enable MMU and D-cache immediately after relocation - Do necessary initialization before enabling d-cache and MMU - Changes to cleanup_before_linux() - Make changes according to the new framework
Signed-off-by: Aneesh V aneesh@ti.com
The reporter was also able to verify that reverting this patch fixed reading from the internal usb attached microsd card. I'd be lying if I said I understood how.
I think the problem is in one of two areas. Either the patch is incorrect, or it's fix highlighted a bug in the marvell EHCI code. I'll add some folks to the CC who can add more intelligent thoughts. :-)
You can see his error report here [1] which is the exact same error messages I was trying to fix after giving the command 'usb start'.
thx,
Jason.
[1] http://lists.denx.de/pipermail/u-boot/2011-July/097333.html

Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
Also, the following features are used: - Use the Marvell Integrated RTC. - display Marvell CPU/L2/etc speeds if requested.
Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG is accepted into mainline Linux. The source from Globalscale did the same.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net --- MAINTAINERS | 4 + MAKEALL | 1 + board/Marvell/dreamplug/Makefile | 54 +++++++++++ board/Marvell/dreamplug/dreamplug.c | 157 ++++++++++++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 ++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 138 ++++++++++++++++++++++++++++ 8 files changed, 560 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
diff --git a/MAINTAINERS b/MAINTAINERS index 2bba7b4..9affbea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,10 @@ Conn Clark clark@esteem.com
ESTEEM192E MPC8xx
+Jason Cooper u-boot@lakedaemon.net + + dreamplug ARM926EJS (Kirkwood SoC) + Joe D'Abbraccio ljd015@freescale.com
MPC837xERDB MPC837x diff --git a/MAKEALL b/MAKEALL index 51db13e..55a122f 100755 --- a/MAKEALL +++ b/MAKEALL @@ -335,6 +335,7 @@ LIST_ARM9=" \ cp966 \ da830evm \ da850evm \ + dreamplug \ edb9301 \ edb9302 \ edb9302a \ diff --git a/board/Marvell/dreamplug/Makefile b/board/Marvell/dreamplug/Makefile new file mode 100644 index 0000000..9ee5406 --- /dev/null +++ b/board/Marvell/dreamplug/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS := dreamplug.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..cdc094a --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c @@ -0,0 +1,157 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 + */ + +#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "dreamplug.h" + +DECLARE_GLOBAL_DATA_PTR; + +int board_early_init_f(void) +{ + /* + * default gpio configuration + * There are maximum 64 gpios controlled through 2 sets of registers + * the below configuration configures mainly initial LED status + */ + kw_config_gpio(DREAMPLUG_OE_VAL_LOW, + DREAMPLUG_OE_VAL_HIGH, + DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH); + + /* Multi-Purpose Pins Functionality configuration */ + u32 kwmpp_config[] = { + MPP0_SPI_SCn, /* SPI Flash */ + MPP1_SPI_MOSI, + MPP2_SPI_SCK, + MPP3_SPI_MISO, + MPP4_NF_IO6, + MPP5_NF_IO7, + MPP6_SYSRST_OUTn, + MPP7_GPO, + MPP8_TW_SDA, + MPP9_TW_SCK, + MPP10_UART0_TXD, /* Serial */ + MPP11_UART0_RXD, + MPP12_SD_CLK, /* SDIO Slot */ + MPP13_SD_CMD, + MPP14_SD_D0, + MPP15_SD_D1, + MPP16_SD_D2, + MPP17_SD_D3, + MPP18_NF_IO0, + MPP19_NF_IO1, + MPP20_GE1_0, /* Gigabit Ethernet */ + MPP21_GE1_1, + MPP22_GE1_2, + MPP23_GE1_3, + MPP24_GE1_4, + MPP25_GE1_5, + MPP26_GE1_6, + MPP27_GE1_7, + MPP28_GE1_8, + MPP29_GE1_9, + MPP30_GE1_10, + MPP31_GE1_11, + MPP32_GE1_12, + MPP33_GE1_13, + MPP34_GE1_14, + MPP35_GE1_15, + MPP36_GPIO, + MPP37_GPIO, + MPP38_GPIO, + MPP39_GPIO, + MPP40_TDM_SPI_SCK, + MPP41_TDM_SPI_MISO, + MPP42_TDM_SPI_MOSI, + MPP43_GPIO, + MPP44_GPIO, + MPP45_GPIO, + MPP46_GPIO, /* Wifi AP LED */ + MPP47_GPIO, + MPP48_GPIO, /* Wifi LED */ + MPP49_GPIO, + 0 + }; + kirkwood_mpp_conf(kwmpp_config); + return 0; +} + +int board_init(void) +{ + /* + * arch number of board + * XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline. + */ + gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG; + + /* adress of boot parameters */ + gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; + + return 0; +} + +#ifdef CONFIG_RESET_PHY_R +void mv_phy_88e1121_init(char *name) +{ + u16 reg; + u16 devadr; + + if (miiphy_set_current_dev(name)) + return; + + /* command to read PHY dev address */ + if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { + printf("Err..%s could not read PHY dev address\n", + __FUNCTION__); + return; + } + + /* + * Enable RGMII delay on Tx and Rx for CPU port + * Ref: sec 4.7.2 of chip datasheet + */ + miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2); + miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, ®); + reg |= (MV88E1121_RGMII_RXTM_CTRL | MV88E1121_RGMII_TXTM_CTRL); + miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg); + miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0); + + /* reset the phy */ + miiphy_reset(name, devadr); + + printf("88E1116 Initialized on %s\n", name); +} + +void reset_phy(void) +{ + /* configure and initialize both PHY's */ + mv_phy_88e1121_init("egiga0"); + mv_phy_88e1121_init("egiga1"); +} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h new file mode 100644 index 0000000..21bf644 --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.h @@ -0,0 +1,42 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 __DREAMPLUG_H +#define __DREAMPLUG_H + +#define DREAMPLUG_OE_LOW (~(0)) +#define DREAMPLUG_OE_HIGH (~(0)) +#define DREAMPLUG_OE_VAL_LOW 0 +#define DREAMPLUG_OE_VAL_HIGH (0xf << 16) /* 4 LED Pins high */ + +/* PHY related */ +#define MV88E1121_MAC_CTRL2_REG 21 +#define MV88E1121_PGADR_REG 22 +#define MV88E1121_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1121_RGMII_RXTM_CTRL (1 << 5) + +#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg new file mode 100644 index 0000000..ca9cd74 --- /dev/null +++ b/board/Marvell/dreamplug/kwbimage.cfg @@ -0,0 +1,163 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM spi + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0/1 interface pad voltage to 1.8V +DATA 0xFFD100e0 0x1b1b9b9b + +#Dram initalization for SINGLE x16 CL=5 @ 400MHz +DATA 0xFFD01400 0x43000c30 # DDR Configuration register +# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01 + +DATA 0xFFD01404 0x37543000 # DDR Controller Control Low +# bit 4: 0=addr/cmd in smame cycle +# bit 5: 0=clk is driven during self refresh, we don't care for APX +# bit 6: 0=use recommended falling edge of clk for addr/cmd +# bit14: 0=input buffer always powered up +# bit18: 1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31: 0=no additional STARTBURST delay + +DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) +# bit3-0: TRAS lsbs +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20: TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP + +DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required + +DATA 0xFFD01410 0x000000cc # DDR Address Control +# bit1-0: 01, Cs0width=x8 +# bit3-2: 10, Cs0size=1Gb +# bit5-4: 01, Cs1width=x8 +# bit7-6: 10, Cs1size=1Gb +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16: 0, Cs0AddrSel +# bit17: 0, Cs1AddrSel +# bit18: 0, Cs2AddrSel +# bit19: 0, Cs3AddrSel +# bit31-20: 0 required + +DATA 0xFFD01414 0x00000000 # DDR Open Pages Control +# bit0: 0, OpenPage enabled +# bit31-1: 0 required + +DATA 0xFFD01418 0x00000000 # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required + +DATA 0xFFD0141C 0x00000C52 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery ???????????? +# bit12: 0, PD must be zero +# bit31-13: 0 required + +DATA 0xFFD01420 0x00000040 # DDR Extended Mode +# bit0: 0, DDR DLL enabled +# bit1: 0, DDR drive strenght normal +# bit2: 0, DDR ODT control lsd (disabled) +# bit5-3: 000, required +# bit6: 1, DDR ODT control msb, (disabled) +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required + +DATA 0xFFD01424 0x0000F17F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 0 +# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz +# bit9 : 0 , no half clock cycle addition to dataout +# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals +# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh +# bit15-12: 1111 required +# bit31-16: 0 required + +DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) +DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) + +DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 +DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size +# bit0: 1, Window enabled +# bit1: 0, Write Protect disabled +# bit3-2: 00, CS0 hit selected +# bit23-4: ones, required +# bit31-24: 0x0F, Size (i.e. 256MB) + +DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb +DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1 + +DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled +DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled + +DATA 0xFFD01494 0x00030000 # DDR ODT Control (Low) +DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) +# bit1-0: 00, ODT0 controlled by ODT Control (low) register above +# bit3-2: 01, ODT1 active NEVER! +# bit31-4: zero, required + +DATA 0xFFD0149C 0x0000E803 # CPU ODT Control +DATA 0xFFD01480 0x00000001 # DDR Initialization Control +#bit0=1, enable DDR init upon this register write + +# End of Header extension +DATA 0x0 0x0 diff --git a/boards.cfg b/boards.cfg index dfefc3f..294c675 100644 --- a/boards.cfg +++ b/boards.cfg @@ -118,6 +118,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood suen8 arm arm926ejs km_arm keymile kirkwood mgcoge3un arm arm926ejs km_arm keymile kirkwood +dreamplug arm arm926ejs - Marvell kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..2a908f4 --- /dev/null +++ b/include/configs/dreamplug.h @@ -0,0 +1,138 @@ +/* + * (C) Copyright 2011 + * Jason Cooper u-boot@lakedaemon.net + * + * Based on work by: + * Marvell Semiconductor <www.marvell.com> + * Written-by: Siddarth Gore gores@marvell.com + * + * 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 _CONFIG_DREAMPLUG_H +#define _CONFIG_DREAMPLUG_H + +/* + * Version number information + */ +#define CONFIG_IDENT_STRING "\nMarvell-DreamPlug" + +/* + * High Level Configuration Options (easy to change) + */ +#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_GURUPLUG /* Machine type */ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* + * Commands configuration + */ +#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#include <config_cmd_default.h> +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ENV +#define CONFIG_CMD_FAT +#define CONFIG_CMD_SF +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_CMD_IDE +#define CONFIG_CMD_DATE + +/* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros + */ +#include "mv-common.h" + +/* + * Environment variables configurations + */ +#ifdef CONFIG_SPI_FLASH +#define CONFIG_ENV_IS_IN_SPI_FLASH 1 +#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64k */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif + +#ifdef CONFIG_CMD_SF +#define CONFIG_SPI_FLASH 1 +#define CONFIG_HARD_SPI 1 +#define CONFIG_KIRKWOOD_SPI 1 +#define CONFIG_SPI_FLASH_MACRONIX 1 +#define CONFIG_ENV_SPI_BUS 0 +#define CONFIG_ENV_SPI_CS 0 +#define CONFIG_ENV_SPI_MAX_HZ 50000000 /* 50 MHz */ +#endif + +/* + * max 4k env size is enough, but in case of nand + * it has to be rounded to sector size + */ +#define CONFIG_ENV_SIZE 0x1000 /* 4k */ +#define CONFIG_ENV_ADDR 0x100000 +#define CONFIG_ENV_OFFSET 0x100000 /* env starts here */ + +/* + * Default environment variables + */ +#define CONFIG_BOOTCOMMAND "setenv ethact egiga0; " \ + "${x_bootcmd_ethernet}; setenv ethact egiga1; " \ + "${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; "\ + "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \ + "bootm 0x6400000;" + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "x_bootcmd_ethernet=ping 192.168.2.1\0" \ + "x_bootcmd_usb=usb start\0" \ + "x_bootcmd_kernel=fatload usb 0 0x6400000 uImage\0" \ + "x_bootargs=console=ttyS0,115200\0" \ + "x_bootargs_root=root=/dev/sda2 rootdelay=10\0" + +/* + * Ethernet Driver configuration + */ +#ifdef CONFIG_CMD_NET +#define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +#define CONFIG_PHY_BASE_ADR 0 +#endif /* CONFIG_CMD_NET */ + +/* + * SATA Driver configuration + */ +#ifdef CONFIG_MVSATA_IDE +#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET +#endif /*CONFIG_MVSATA_IDE*/ + +/* + * RTC driver configuration + */ +#ifdef CONFIG_CMD_DATE +#define CONFIG_RTC_MVINTEG +#endif /* CONFIG_CMD_DATE */ + +#define CONFIG_SYS_ALT_MEMTEST + +/* + * display enhanced info about the cpu at boot. + */ +#define CONFIG_DISPLAY_CPUINFO + +#endif /* _CONFIG_DREAMPLUG_H */

-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 4/5 v5] dreamplug: initial board support.
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
Also, the following features are used: - Use the Marvell Integrated RTC. - display Marvell CPU/L2/etc speeds if requested.
Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG is accepted into mainline Linux. The source from Globalscale did the same.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
There is no change log for all previous versions. Please put them here. Ref: http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
MAINTAINERS | 4 + MAKEALL | 1 + board/Marvell/dreamplug/Makefile | 54 +++++++++++ board/Marvell/dreamplug/dreamplug.c | 157 ++++++++++++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 ++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 138 ++++++++++++++++++++++++++++ 8 files changed, 560 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
diff --git a/MAINTAINERS b/MAINTAINERS index 2bba7b4..9affbea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,10 @@ Conn Clark clark@esteem.com
ESTEEM192E MPC8xx
+Jason Cooper u-boot@lakedaemon.net
dreamplug ARM926EJS (Kirkwood SoC)
Joe D'Abbraccio ljd015@freescale.com
MPC837xERDB MPC837x
diff --git a/MAKEALL b/MAKEALL index 51db13e..55a122f 100755 --- a/MAKEALL +++ b/MAKEALL @@ -335,6 +335,7 @@ LIST_ARM9=" \ cp966 \ da830evm \ da850evm \
dreamplug \ edb9301 \ edb9302 \ edb9302a \
diff --git a/board/Marvell/dreamplug/Makefile b/board/Marvell/dreamplug/Makefile new file mode 100644 index 0000000..9ee5406 --- /dev/null +++ b/board/Marvell/dreamplug/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +#
+include $(TOPDIR)/config.mk
+LIB = $(obj)lib$(BOARD).o
+COBJS := dreamplug.o
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS))
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(call cmd_link_o_target, $(OBJS) $(SOBJS))
+clean:
rm -f $(SOBJS) $(OBJS)
+distclean: clean
rm -f $(LIB) core *.bak .depend
+####################################################################### ##
+# defines $(obj).depend target +include $(SRCTREE)/rules.mk
+sinclude $(obj).depend
+####################################################################### ## diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..cdc094a --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c @@ -0,0 +1,157 @@ +/*
- (C) Copyright 2011
- Jason Cooper u-boot@lakedaemon.net
- Based on work by:
- Marvell Semiconductor <www.marvell.com>
- Written-by: Siddarth Gore gores@marvell.com
- 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
- */
+#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "dreamplug.h"
+DECLARE_GLOBAL_DATA_PTR;
+int board_early_init_f(void) +{
/*
* default gpio configuration
* There are maximum 64 gpios controlled through 2 sets of registers
* the below configuration configures mainly initial LED status
*/
kw_config_gpio(DREAMPLUG_OE_VAL_LOW,
DREAMPLUG_OE_VAL_HIGH,
DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH);
/* Multi-Purpose Pins Functionality configuration */
u32 kwmpp_config[] = {
MPP0_SPI_SCn, /* SPI Flash */
MPP1_SPI_MOSI,
MPP2_SPI_SCK,
MPP3_SPI_MISO,
MPP4_NF_IO6,
MPP5_NF_IO7,
MPP6_SYSRST_OUTn,
MPP7_GPO,
MPP8_TW_SDA,
MPP9_TW_SCK,
MPP10_UART0_TXD, /* Serial */
MPP11_UART0_RXD,
MPP12_SD_CLK, /* SDIO Slot */
MPP13_SD_CMD,
MPP14_SD_D0,
MPP15_SD_D1,
MPP16_SD_D2,
MPP17_SD_D3,
MPP18_NF_IO0,
MPP19_NF_IO1,
MPP20_GE1_0, /* Gigabit Ethernet */
MPP21_GE1_1,
MPP22_GE1_2,
MPP23_GE1_3,
MPP24_GE1_4,
MPP25_GE1_5,
MPP26_GE1_6,
MPP27_GE1_7,
MPP28_GE1_8,
MPP29_GE1_9,
MPP30_GE1_10,
MPP31_GE1_11,
MPP32_GE1_12,
MPP33_GE1_13,
MPP34_GE1_14,
MPP35_GE1_15,
MPP36_GPIO,
MPP37_GPIO,
MPP38_GPIO,
MPP39_GPIO,
MPP40_TDM_SPI_SCK,
MPP41_TDM_SPI_MISO,
MPP42_TDM_SPI_MOSI,
MPP43_GPIO,
MPP44_GPIO,
MPP45_GPIO,
MPP46_GPIO, /* Wifi AP LED */
MPP47_GPIO,
MPP48_GPIO, /* Wifi LED */
It is better if you can comment about rest other GPIOSs with their assigned functionality.
MPP49_GPIO,
0
};
kirkwood_mpp_conf(kwmpp_config);
return 0;
+}
+int board_init(void) +{
/*
* arch number of board
* XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline.
*/
gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG;
I think this board should have some delta to guruplug? I think you should have different machine ID here.
BTW: what is delta w.r.to guruplug?
/* adress of boot parameters */
gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
return 0;
+}
+#ifdef CONFIG_RESET_PHY_R +void mv_phy_88e1121_init(char *name) +{
u16 reg;
u16 devadr;
if (miiphy_set_current_dev(name))
return;
/* command to read PHY dev address */
if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
printf("Err..%s could not read PHY dev address\n",
__FUNCTION__);
return;
}
/*
* Enable RGMII delay on Tx and Rx for CPU port
* Ref: sec 4.7.2 of chip datasheet
*/
miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2);
miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, ®);
reg |= (MV88E1121_RGMII_RXTM_CTRL | MV88E1121_RGMII_TXTM_CTRL);
miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg);
miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0);
/* reset the phy */
miiphy_reset(name, devadr);
printf("88E1116 Initialized on %s\n", name);
Function name and print info are mismatching.
+}
+void reset_phy(void) +{
/* configure and initialize both PHY's */
mv_phy_88e1121_init("egiga0");
mv_phy_88e1121_init("egiga1");
+} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h new file mode 100644 index 0000000..21bf644 --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.h @@ -0,0 +1,42 @@ +/*
- (C) Copyright 2011
- Jason Cooper u-boot@lakedaemon.net
- Based on work by:
- Marvell Semiconductor <www.marvell.com>
- Written-by: Siddarth Gore gores@marvell.com
- 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 __DREAMPLUG_H +#define __DREAMPLUG_H
+#define DREAMPLUG_OE_LOW (~(0)) +#define DREAMPLUG_OE_HIGH (~(0)) +#define DREAMPLUG_OE_VAL_LOW 0 +#define DREAMPLUG_OE_VAL_HIGH (0xf << 16) /* 4 LED Pins high */
+/* PHY related */ +#define MV88E1121_MAC_CTRL2_REG 21 +#define MV88E1121_PGADR_REG 22 +#define MV88E1121_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1121_RGMII_RXTM_CTRL (1 << 5)
+#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg
I hope this is not same as guruplug (since you are using same machine-id)?
new file mode 100644 index 0000000..ca9cd74 --- /dev/null +++ b/board/Marvell/dreamplug/kwbimage.cfg @@ -0,0 +1,163 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +#
+# Boot Media configurations +BOOT_FROM spi
+# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed
+# Configure RGMII-0/1 interface pad voltage to 1.8V +DATA 0xFFD100e0 0x1b1b9b9b
+#Dram initalization for SINGLE x16 CL=5 @ 400MHz +DATA 0xFFD01400 0x43000c30 # DDR Configuration register +# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01
+DATA 0xFFD01404 0x37543000 # DDR Controller Control Low +# bit 4: 0=addr/cmd in smame cycle +# bit 5: 0=clk is driven during self refresh, we don't care for APX +# bit 6: 0=use recommended falling edge of clk for addr/cmd +# bit14: 0=input buffer always powered up +# bit18: 1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31: 0=no additional STARTBURST delay
+DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) +# bit3-0: TRAS lsbs +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20: TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP
+DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required
+DATA 0xFFD01410 0x000000cc # DDR Address Control +# bit1-0: 01, Cs0width=x8 +# bit3-2: 10, Cs0size=1Gb +# bit5-4: 01, Cs1width=x8 +# bit7-6: 10, Cs1size=1Gb +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16: 0, Cs0AddrSel +# bit17: 0, Cs1AddrSel +# bit18: 0, Cs2AddrSel +# bit19: 0, Cs3AddrSel +# bit31-20: 0 required
+DATA 0xFFD01414 0x00000000 # DDR Open Pages Control +# bit0: 0, OpenPage enabled +# bit31-1: 0 required
+DATA 0xFFD01418 0x00000000 # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required
+DATA 0xFFD0141C 0x00000C52 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery ???????????? +# bit12: 0, PD must be zero +# bit31-13: 0 required
+DATA 0xFFD01420 0x00000040 # DDR Extended Mode +# bit0: 0, DDR DLL enabled +# bit1: 0, DDR drive strenght normal +# bit2: 0, DDR ODT control lsd (disabled) +# bit5-3: 000, required +# bit6: 1, DDR ODT control msb, (disabled) +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required
+DATA 0xFFD01424 0x0000F17F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 0 +# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz +# bit9 : 0 , no half clock cycle addition to dataout +# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals +# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh +# bit15-12: 1111 required +# bit31-16: 0 required
+DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) +DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values)
+DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 +DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size +# bit0: 1, Window enabled +# bit1: 0, Write Protect disabled +# bit3-2: 00, CS0 hit selected +# bit23-4: ones, required +# bit31-24: 0x0F, Size (i.e. 256MB)
+DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb +DATA 0xFFD0150C 0x0FFFFFF5 # CS[1]n Size 256Mb Window enabled for CS1
+DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled +DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled
+DATA 0xFFD01494 0x00030000 # DDR ODT Control (Low) +DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) +# bit1-0: 00, ODT0 controlled by ODT Control (low) register above +# bit3-2: 01, ODT1 active NEVER! +# bit31-4: zero, required
+DATA 0xFFD0149C 0x0000E803 # CPU ODT Control +DATA 0xFFD01480 0x00000001 # DDR Initialization Control +#bit0=1, enable DDR init upon this register write
+# End of Header extension +DATA 0x0 0x0 diff --git a/boards.cfg b/boards.cfg index dfefc3f..294c675 100644 --- a/boards.cfg +++ b/boards.cfg @@ -118,6 +118,7 @@ davinci_sonata arm arm926ejs sonata davinci suen3 arm arm926ejs km_arm keymile kirkwood suen8 arm arm926ejs km_arm keymile kirkwood mgcoge3un arm arm926ejs km_arm keymile kirkwood +dreamplug arm arm926ejs - Marvell kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs openrd Marvell kirkwood openrd:BOARD_IS_OPENRD_BASE diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h new file mode 100644 index 0000000..2a908f4 --- /dev/null +++ b/include/configs/dreamplug.h @@ -0,0 +1,138 @@ +/*
- (C) Copyright 2011
- Jason Cooper u-boot@lakedaemon.net
- Based on work by:
- Marvell Semiconductor <www.marvell.com>
- Written-by: Siddarth Gore gores@marvell.com
- 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 _CONFIG_DREAMPLUG_H +#define _CONFIG_DREAMPLUG_H
+/*
- Version number information
- */
+#define CONFIG_IDENT_STRING "\nMarvell-DreamPlug"
+/*
- High Level Configuration Options (easy to change)
- */
+#define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ +#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ +#define CONFIG_MACH_GURUPLUG /* Machine type */ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
+/*
- Commands configuration
- */
+#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#include <config_cmd_default.h> +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ENV +#define CONFIG_CMD_FAT +#define CONFIG_CMD_SF +#define CONFIG_CMD_PING +#define CONFIG_CMD_USB +#define CONFIG_CMD_IDE +#define CONFIG_CMD_DATE
+/*
- mv-common.h should be defined after CMD configs since it used them
- to enable certain macros
- */
+#include "mv-common.h"
+/*
- Environment variables configurations
- */
+#ifdef CONFIG_SPI_FLASH +#define CONFIG_ENV_IS_IN_SPI_FLASH 1 +#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64k */ +#else +#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif
+#ifdef CONFIG_CMD_SF +#define CONFIG_SPI_FLASH 1 +#define CONFIG_HARD_SPI 1 +#define CONFIG_KIRKWOOD_SPI 1 +#define CONFIG_SPI_FLASH_MACRONIX 1 +#define CONFIG_ENV_SPI_BUS 0 +#define CONFIG_ENV_SPI_CS 0 +#define CONFIG_ENV_SPI_MAX_HZ 50000000 /* 50 MHz */ +#endif
+/*
- max 4k env size is enough, but in case of nand
- it has to be rounded to sector size
- */
+#define CONFIG_ENV_SIZE 0x1000 /* 4k */ +#define CONFIG_ENV_ADDR 0x100000 +#define CONFIG_ENV_OFFSET 0x100000 /* env starts here */
+/*
- Default environment variables
- */
+#define CONFIG_BOOTCOMMAND "setenv ethact egiga0; " \
"${x_bootcmd_ethernet}; setenv ethact egiga1; " \
"${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; "\
"setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \
"bootm 0x6400000;"
+#define CONFIG_EXTRA_ENV_SETTINGS \
"x_bootcmd_ethernet=ping 192.168.2.1\0" \
"x_bootcmd_usb=usb start\0" \
"x_bootcmd_kernel=fatload usb 0 0x6400000 uImage\0" \
"x_bootargs=console=ttyS0,115200\0" \
"x_bootargs_root=root=/dev/sda2 rootdelay=10\0"
+/*
- Ethernet Driver configuration
- */
+#ifdef CONFIG_CMD_NET +#define CONFIG_MVGBE_PORTS {1, 1} /* enable both ports */ +#define CONFIG_PHY_BASE_ADR 0 +#endif /* CONFIG_CMD_NET */
+/*
- SATA Driver configuration
- */
+#ifdef CONFIG_MVSATA_IDE +#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET +#endif /*CONFIG_MVSATA_IDE*/
+/*
- RTC driver configuration
- */
+#ifdef CONFIG_CMD_DATE +#define CONFIG_RTC_MVINTEG +#endif /* CONFIG_CMD_DATE */
+#define CONFIG_SYS_ALT_MEMTEST
+/*
- display enhanced info about the cpu at boot.
- */
+#define CONFIG_DISPLAY_CPUINFO
+#endif /* _CONFIG_DREAMPLUG_H */
Regards.. Prafulla . .
1.7.0.4

On Wed, Jul 27, 2011 at 11:38:55AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 4/5 v5] dreamplug: initial board support.
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
Also, the following features are used: - Use the Marvell Integrated RTC. - display Marvell CPU/L2/etc speeds if requested.
Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG is accepted into mainline Linux. The source from Globalscale did the same.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
There is no change log for all previous versions. Please put them here. Ref: http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
%$#%@#. I knew I forgot something. Here it is:
Changes from v1 to v2:
- resorted series to move 'make all' support last.
Changes from v2 to v3:
- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux. - Update MAINTAINERS. - Collapse into one patch.
Changes from v3 to v4:
- update copyright info as recommended by Prafulla Wadaskar. - maintain proper order in boards.cfg, MAINTAINERS, etc. - label MPP's - change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_ added).
Changes from v4 to v5:
- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech. - Added driver for integrated RTC. (thx GST!) - Added support for displaying CPU frequencies at boot. (thx GST!) - Adjust USB timeout to handle dreamplug EHCI chipset. - Cleaned up MPP registers based on Global Scale code. (thx GST!) - broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to use MACH_TYPE_DREAMPLUG.
MAINTAINERS | 4 + MAKEALL | 1 + board/Marvell/dreamplug/Makefile | 54 +++++++++++ board/Marvell/dreamplug/dreamplug.c | 157 ++++++++++++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 ++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 138 ++++++++++++++++++++++++++++ 8 files changed, 560 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
diff --git a/MAINTAINERS b/MAINTAINERS index 2bba7b4..9affbea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,10 @@ Conn Clark clark@esteem.com
ESTEEM192E MPC8xx
+Jason Cooper u-boot@lakedaemon.net
dreamplug ARM926EJS (Kirkwood SoC)
Joe D'Abbraccio ljd015@freescale.com
MPC837xERDB MPC837x
diff --git a/MAKEALL b/MAKEALL index 51db13e..55a122f 100755 --- a/MAKEALL +++ b/MAKEALL @@ -335,6 +335,7 @@ LIST_ARM9=" \ cp966 \ da830evm \ da850evm \
dreamplug \ edb9301 \ edb9302 \ edb9302a \
diff --git a/board/Marvell/dreamplug/Makefile b/board/Marvell/dreamplug/Makefile new file mode 100644 index 0000000..9ee5406 --- /dev/null +++ b/board/Marvell/dreamplug/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +#
+include $(TOPDIR)/config.mk
+LIB = $(obj)lib$(BOARD).o
+COBJS := dreamplug.o
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS))
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(call cmd_link_o_target, $(OBJS) $(SOBJS))
+clean:
rm -f $(SOBJS) $(OBJS)
+distclean: clean
rm -f $(LIB) core *.bak .depend
+####################################################################### ##
+# defines $(obj).depend target +include $(SRCTREE)/rules.mk
+sinclude $(obj).depend
+####################################################################### ## diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..cdc094a --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c @@ -0,0 +1,157 @@ +/*
- (C) Copyright 2011
- Jason Cooper u-boot@lakedaemon.net
- Based on work by:
- Marvell Semiconductor <www.marvell.com>
- Written-by: Siddarth Gore gores@marvell.com
- 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
- */
+#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "dreamplug.h"
+DECLARE_GLOBAL_DATA_PTR;
+int board_early_init_f(void) +{
/*
* default gpio configuration
* There are maximum 64 gpios controlled through 2 sets of registers
* the below configuration configures mainly initial LED status
*/
kw_config_gpio(DREAMPLUG_OE_VAL_LOW,
DREAMPLUG_OE_VAL_HIGH,
DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH);
/* Multi-Purpose Pins Functionality configuration */
u32 kwmpp_config[] = {
MPP0_SPI_SCn, /* SPI Flash */
MPP1_SPI_MOSI,
MPP2_SPI_SCK,
MPP3_SPI_MISO,
MPP4_NF_IO6,
MPP5_NF_IO7,
MPP6_SYSRST_OUTn,
MPP7_GPO,
MPP8_TW_SDA,
MPP9_TW_SCK,
MPP10_UART0_TXD, /* Serial */
MPP11_UART0_RXD,
MPP12_SD_CLK, /* SDIO Slot */
MPP13_SD_CMD,
MPP14_SD_D0,
MPP15_SD_D1,
MPP16_SD_D2,
MPP17_SD_D3,
MPP18_NF_IO0,
MPP19_NF_IO1,
MPP20_GE1_0, /* Gigabit Ethernet */
MPP21_GE1_1,
MPP22_GE1_2,
MPP23_GE1_3,
MPP24_GE1_4,
MPP25_GE1_5,
MPP26_GE1_6,
MPP27_GE1_7,
MPP28_GE1_8,
MPP29_GE1_9,
MPP30_GE1_10,
MPP31_GE1_11,
MPP32_GE1_12,
MPP33_GE1_13,
MPP34_GE1_14,
MPP35_GE1_15,
MPP36_GPIO,
MPP37_GPIO,
MPP38_GPIO,
MPP39_GPIO,
MPP40_TDM_SPI_SCK,
MPP41_TDM_SPI_MISO,
MPP42_TDM_SPI_MOSI,
MPP43_GPIO,
MPP44_GPIO,
MPP45_GPIO,
MPP46_GPIO, /* Wifi AP LED */
MPP47_GPIO,
MPP48_GPIO, /* Wifi LED */
It is better if you can comment about rest other GPIOSs with their assigned functionality.
I filled in what I was comfortable labeling, anything else would be a guess on my part. This is a standard kirkwood configuration except for pins 0-3 and the LEDS (46,48). Should I add a comment to the same effect?
MPP49_GPIO,
0
};
kirkwood_mpp_conf(kwmpp_config);
return 0;
+}
+int board_init(void) +{
/*
* arch number of board
* XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline.
*/
gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG;
I think this board should have some delta to guruplug? I think you should have different machine ID here.
See added changelog and patch 5 in the series.
BTW: what is delta w.r.to guruplug?
Just 2MB SPI flash instead of 512MB NAND flash. It grabs the kernel/initrd from an internal microSD card attached via USB, instead of NAND flash. OS is on the same microSD card.
The dreamplug kernel shipped with the device doesn't even see the SPI flash. I think it may be the exact same as the guruplug kernel, although I haven't done a rigorous check. It's built for MACH_TYPE_GURUPLUG, though.
It has some bells and whistles, like audio in/out, SPDIF out. Nothing else really relevant to u-boot.
/* adress of boot parameters */
gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
return 0;
+}
+#ifdef CONFIG_RESET_PHY_R +void mv_phy_88e1121_init(char *name) +{
u16 reg;
u16 devadr;
if (miiphy_set_current_dev(name))
return;
/* command to read PHY dev address */
if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
printf("Err..%s could not read PHY dev address\n",
__FUNCTION__);
return;
}
/*
* Enable RGMII delay on Tx and Rx for CPU port
* Ref: sec 4.7.2 of chip datasheet
*/
miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2);
miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, ®);
reg |= (MV88E1121_RGMII_RXTM_CTRL | MV88E1121_RGMII_TXTM_CTRL);
miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg);
miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0);
/* reset the phy */
miiphy_reset(name, devadr);
printf("88E1116 Initialized on %s\n", name);
Function name and print info are mismatching.
Gah! good catch. I just copied that printf over from the GST source code. I'll fix it up.
+}
+void reset_phy(void) +{
/* configure and initialize both PHY's */
mv_phy_88e1121_init("egiga0");
mv_phy_88e1121_init("egiga1");
+} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h new file mode 100644 index 0000000..21bf644 --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.h @@ -0,0 +1,42 @@ +/*
- (C) Copyright 2011
- Jason Cooper u-boot@lakedaemon.net
- Based on work by:
- Marvell Semiconductor <www.marvell.com>
- Written-by: Siddarth Gore gores@marvell.com
- 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 __DREAMPLUG_H +#define __DREAMPLUG_H
+#define DREAMPLUG_OE_LOW (~(0)) +#define DREAMPLUG_OE_HIGH (~(0)) +#define DREAMPLUG_OE_VAL_LOW 0 +#define DREAMPLUG_OE_VAL_HIGH (0xf << 16) /* 4 LED Pins high */
+/* PHY related */ +#define MV88E1121_MAC_CTRL2_REG 21 +#define MV88E1121_PGADR_REG 22 +#define MV88E1121_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1121_RGMII_RXTM_CTRL (1 << 5)
+#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg
I hope this is not same as guruplug (since you are using same machine-id)?
Very similar, see above.
thx,
Jason.

-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Thursday, July 28, 2011 7:33 AM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 4/5 v5] dreamplug: initial board support.
On Wed, Jul 27, 2011 at 11:38:55AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;
Siddarth
Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 4/5 v5] dreamplug: initial board support.
Copied wholeheartedly from board/Marvell/guruplug and modified to
add
support for SPI NOR flash.
Also, the following features are used: - Use the Marvell Integrated RTC. - display Marvell CPU/L2/etc speeds if requested.
Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG
is
accepted into mainline Linux. The source from Globalscale did the same.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
There is no change log for all previous versions. Please put them here. Ref: http://www.denx.de/wiki/view/U-
Boot/Patches#Sending_updated_patch_versions
%$#%@#. I knew I forgot something. Here it is:
Changes from v1 to v2:
- resorted series to move 'make all' support last.
Changes from v2 to v3:
- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux. - Update MAINTAINERS. - Collapse into one patch.
Changes from v3 to v4:
- update copyright info as recommended by Prafulla Wadaskar. - maintain proper order in boards.cfg, MAINTAINERS, etc. - label MPP's - change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_
added).
Changes from v4 to v5:
- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech. - Added driver for integrated RTC. (thx GST!) - Added support for displaying CPU frequencies at boot. (thx GST!) - Adjust USB timeout to handle dreamplug EHCI chipset. - Cleaned up MPP registers based on Global Scale code. (thx GST!) - broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to
use MACH_TYPE_DREAMPLUG.
Please kindly repost with changelog.
MAINTAINERS | 4 + MAKEALL | 1 + board/Marvell/dreamplug/Makefile | 54 +++++++++++ board/Marvell/dreamplug/dreamplug.c | 157 ++++++++++++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 ++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 138 ++++++++++++++++++++++++++++ 8 files changed, 560 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
diff --git a/MAINTAINERS b/MAINTAINERS index 2bba7b4..9affbea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,10 @@ Conn Clark clark@esteem.com
ESTEEM192E MPC8xx
+Jason Cooper u-boot@lakedaemon.net
dreamplug ARM926EJS (Kirkwood SoC)
Joe D'Abbraccio ljd015@freescale.com
MPC837xERDB MPC837x
diff --git a/MAKEALL b/MAKEALL index 51db13e..55a122f 100755 --- a/MAKEALL +++ b/MAKEALL @@ -335,6 +335,7 @@ LIST_ARM9=" \ cp966 \ da830evm \ da850evm \
dreamplug \ edb9301 \ edb9302 \ edb9302a \
diff --git a/board/Marvell/dreamplug/Makefile b/board/Marvell/dreamplug/Makefile new file mode 100644 index 0000000..9ee5406 --- /dev/null +++ b/board/Marvell/dreamplug/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +#
+include $(TOPDIR)/config.mk
+LIB = $(obj)lib$(BOARD).o
+COBJS := dreamplug.o
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS))
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(call cmd_link_o_target, $(OBJS) $(SOBJS))
+clean:
rm -f $(SOBJS) $(OBJS)
+distclean: clean
rm -f $(LIB) core *.bak .depend
+#######################################################################
##
+# defines $(obj).depend target +include $(SRCTREE)/rules.mk
+sinclude $(obj).depend
+#######################################################################
## diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..cdc094a --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c @@ -0,0 +1,157 @@ +/*
- (C) Copyright 2011
- Jason Cooper u-boot@lakedaemon.net
- Based on work by:
- Marvell Semiconductor <www.marvell.com>
- Written-by: Siddarth Gore gores@marvell.com
- 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
- */
+#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "dreamplug.h"
+DECLARE_GLOBAL_DATA_PTR;
+int board_early_init_f(void) +{
/*
* default gpio configuration
* There are maximum 64 gpios controlled through 2 sets of
registers
* the below configuration configures mainly initial LED
status
*/
kw_config_gpio(DREAMPLUG_OE_VAL_LOW,
DREAMPLUG_OE_VAL_HIGH,
DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH);
/* Multi-Purpose Pins Functionality configuration */
u32 kwmpp_config[] = {
MPP0_SPI_SCn, /* SPI Flash */
MPP1_SPI_MOSI,
MPP2_SPI_SCK,
MPP3_SPI_MISO,
MPP4_NF_IO6,
MPP5_NF_IO7,
MPP6_SYSRST_OUTn,
MPP7_GPO,
MPP8_TW_SDA,
MPP9_TW_SCK,
MPP10_UART0_TXD, /* Serial */
MPP11_UART0_RXD,
MPP12_SD_CLK, /* SDIO Slot */
MPP13_SD_CMD,
MPP14_SD_D0,
MPP15_SD_D1,
MPP16_SD_D2,
MPP17_SD_D3,
MPP18_NF_IO0,
MPP19_NF_IO1,
MPP20_GE1_0, /* Gigabit Ethernet */
MPP21_GE1_1,
MPP22_GE1_2,
MPP23_GE1_3,
MPP24_GE1_4,
MPP25_GE1_5,
MPP26_GE1_6,
MPP27_GE1_7,
MPP28_GE1_8,
MPP29_GE1_9,
MPP30_GE1_10,
MPP31_GE1_11,
MPP32_GE1_12,
MPP33_GE1_13,
MPP34_GE1_14,
MPP35_GE1_15,
MPP36_GPIO,
MPP37_GPIO,
MPP38_GPIO,
MPP39_GPIO,
MPP40_TDM_SPI_SCK,
MPP41_TDM_SPI_MISO,
MPP42_TDM_SPI_MOSI,
MPP43_GPIO,
MPP44_GPIO,
MPP45_GPIO,
MPP46_GPIO, /* Wifi AP LED */
MPP47_GPIO,
MPP48_GPIO, /* Wifi LED */
It is better if you can comment about rest other GPIOSs with their assigned functionality.
I filled in what I was comfortable labeling, anything else would be a guess on my part. This is a standard kirkwood configuration except for pins 0-3 and the LEDS (46,48). Should I add a comment to the same effect?
My comment was for MPPXX_GPIOs, for rest other macros are enough to explain.
MPP49_GPIO,
0
};
kirkwood_mpp_conf(kwmpp_config);
return 0;
+}
+int board_init(void) +{
/*
* arch number of board
* XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline.
*/
gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG;
I think this board should have some delta to guruplug? I think you should have different machine ID here.
See added changelog and patch 5 in the series.
BTW: what is delta w.r.to guruplug?
Just 2MB SPI flash instead of 512MB NAND flash. It grabs the kernel/initrd from an internal microSD card attached via USB, instead of NAND flash. OS is on the same microSD card.
The dreamplug kernel shipped with the device doesn't even see the SPI flash. I think it may be the exact same as the guruplug kernel, although I haven't done a rigorous check. It's built for MACH_TYPE_GURUPLUG, though.
It has some bells and whistles, like audio in/out, SPDIF out. Nothing else really relevant to u-boot.
/* adress of boot parameters */
gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
return 0;
+}
+#ifdef CONFIG_RESET_PHY_R +void mv_phy_88e1121_init(char *name) +{
u16 reg;
u16 devadr;
if (miiphy_set_current_dev(name))
return;
/* command to read PHY dev address */
if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
printf("Err..%s could not read PHY dev address\n",
__FUNCTION__);
return;
}
/*
* Enable RGMII delay on Tx and Rx for CPU port
* Ref: sec 4.7.2 of chip datasheet
*/
miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2);
miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, ®);
reg |= (MV88E1121_RGMII_RXTM_CTRL |
MV88E1121_RGMII_TXTM_CTRL);
miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg);
miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0);
/* reset the phy */
miiphy_reset(name, devadr);
printf("88E1116 Initialized on %s\n", name);
Function name and print info are mismatching.
Gah! good catch. I just copied that printf over from the GST source code. I'll fix it up.
+}
+void reset_phy(void) +{
/* configure and initialize both PHY's */
mv_phy_88e1121_init("egiga0");
mv_phy_88e1121_init("egiga1");
+} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h new file mode 100644 index 0000000..21bf644 --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.h @@ -0,0 +1,42 @@ +/*
- (C) Copyright 2011
- Jason Cooper u-boot@lakedaemon.net
- Based on work by:
- Marvell Semiconductor <www.marvell.com>
- Written-by: Siddarth Gore gores@marvell.com
- 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 __DREAMPLUG_H +#define __DREAMPLUG_H
+#define DREAMPLUG_OE_LOW (~(0)) +#define DREAMPLUG_OE_HIGH (~(0)) +#define DREAMPLUG_OE_VAL_LOW 0 +#define DREAMPLUG_OE_VAL_HIGH (0xf << 16) /* 4 LED Pins high
*/
+/* PHY related */ +#define MV88E1121_MAC_CTRL2_REG 21 +#define MV88E1121_PGADR_REG 22 +#define MV88E1121_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1121_RGMII_RXTM_CTRL (1 << 5)
+#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg
I hope this is not same as guruplug (since you are using same machine-
id)?
Very similar, see above.
We can overrule this at this and can go ahead having dreamplug as new board support since we have valid machin_id for this board.
Regards.. Prafulla . .

On Thu, Jul 28, 2011 at 12:37:32PM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Thursday, July 28, 2011 7:33 AM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 4/5 v5] dreamplug: initial board support.
On Wed, Jul 27, 2011 at 11:38:55AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;
Siddarth
Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 4/5 v5] dreamplug: initial board support.
Copied wholeheartedly from board/Marvell/guruplug and modified to
add
support for SPI NOR flash.
Also, the following features are used: - Use the Marvell Integrated RTC. - display Marvell CPU/L2/etc speeds if requested.
Note: this still uses MACH_TYPE_GURUPLUG until MACH_TYPE_DREAMPLUG
is
accepted into mainline Linux. The source from Globalscale did the same.
Signed-off-by: Jason Cooper u-boot@lakedaemon.net
There is no change log for all previous versions. Please put them here. Ref: http://www.denx.de/wiki/view/U-
Boot/Patches#Sending_updated_patch_versions
%$#%@#. I knew I forgot something. Here it is:
Changes from v1 to v2:
- resorted series to move 'make all' support last.
Changes from v2 to v3:
- Use MACH_TYPE_GURUPLUG for now until dreamplug support is in Linux. - Update MAINTAINERS. - Collapse into one patch.
Changes from v3 to v4:
- update copyright info as recommended by Prafulla Wadaskar. - maintain proper order in boards.cfg, MAINTAINERS, etc. - label MPP's - change back to MACH_TYPE_DREAMPLUG. This patch is just RFC until the Dreamplug is supported in Linux (and MACH_TYPE_
added).
Changes from v4 to v5:
- Complete rewrite due to receiving u-boot source indirectly from Global Scale Tech. - Added driver for integrated RTC. (thx GST!) - Added support for displaying CPU frequencies at boot. (thx GST!) - Adjust USB timeout to handle dreamplug EHCI chipset. - Cleaned up MPP registers based on Global Scale code. (thx GST!) - broke out MACH_TYPE_DREAMPLUG changes since it's going to be a while until the Linux arm tree gets sorted and accepts new boards again. Since all Dreamplugs currently on the market set r1 to MACH_TYPE_GURUPLUG, this allows the board to be added to u-boot while waiting for Linux mainline. Once it's in Linux mainline, then the last patch can be integrated to
use MACH_TYPE_DREAMPLUG.
Please kindly repost with changelog.
Will do.
MAINTAINERS | 4 + MAKEALL | 1 + board/Marvell/dreamplug/Makefile | 54 +++++++++++ board/Marvell/dreamplug/dreamplug.c | 157 ++++++++++++++++++++++++++++++++ board/Marvell/dreamplug/dreamplug.h | 42 +++++++++ board/Marvell/dreamplug/kwbimage.cfg | 163 ++++++++++++++++++++++++++++++++++ boards.cfg | 1 + include/configs/dreamplug.h | 138 ++++++++++++++++++++++++++++ 8 files changed, 560 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/dreamplug/Makefile create mode 100644 board/Marvell/dreamplug/dreamplug.c create mode 100644 board/Marvell/dreamplug/dreamplug.h create mode 100644 board/Marvell/dreamplug/kwbimage.cfg create mode 100644 include/configs/dreamplug.h
diff --git a/MAINTAINERS b/MAINTAINERS index 2bba7b4..9affbea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -70,6 +70,10 @@ Conn Clark clark@esteem.com
ESTEEM192E MPC8xx
+Jason Cooper u-boot@lakedaemon.net
dreamplug ARM926EJS (Kirkwood SoC)
Joe D'Abbraccio ljd015@freescale.com
MPC837xERDB MPC837x
diff --git a/MAKEALL b/MAKEALL index 51db13e..55a122f 100755 --- a/MAKEALL +++ b/MAKEALL @@ -335,6 +335,7 @@ LIST_ARM9=" \ cp966 \ da830evm \ da850evm \
dreamplug \ edb9301 \ edb9302 \ edb9302a \
diff --git a/board/Marvell/dreamplug/Makefile b/board/Marvell/dreamplug/Makefile new file mode 100644 index 0000000..9ee5406 --- /dev/null +++ b/board/Marvell/dreamplug/Makefile @@ -0,0 +1,54 @@ +# +# (C) Copyright 2011 +# Jason Cooper u-boot@lakedaemon.net +# +# Based on work by: +# Marvell Semiconductor <www.marvell.com> +# Written-by: Siddarth Gore gores@marvell.com +# +# 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 +#
+include $(TOPDIR)/config.mk
+LIB = $(obj)lib$(BOARD).o
+COBJS := dreamplug.o
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS))
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(call cmd_link_o_target, $(OBJS) $(SOBJS))
+clean:
rm -f $(SOBJS) $(OBJS)
+distclean: clean
rm -f $(LIB) core *.bak .depend
+#######################################################################
##
+# defines $(obj).depend target +include $(SRCTREE)/rules.mk
+sinclude $(obj).depend
+#######################################################################
## diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c new file mode 100644 index 0000000..cdc094a --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.c @@ -0,0 +1,157 @@ +/*
- (C) Copyright 2011
- Jason Cooper u-boot@lakedaemon.net
- Based on work by:
- Marvell Semiconductor <www.marvell.com>
- Written-by: Siddarth Gore gores@marvell.com
- 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
- */
+#include <common.h> +#include <miiphy.h> +#include <asm/arch/kirkwood.h> +#include <asm/arch/mpp.h> +#include "dreamplug.h"
+DECLARE_GLOBAL_DATA_PTR;
+int board_early_init_f(void) +{
/*
* default gpio configuration
* There are maximum 64 gpios controlled through 2 sets of
registers
* the below configuration configures mainly initial LED
status
*/
kw_config_gpio(DREAMPLUG_OE_VAL_LOW,
DREAMPLUG_OE_VAL_HIGH,
DREAMPLUG_OE_LOW, DREAMPLUG_OE_HIGH);
/* Multi-Purpose Pins Functionality configuration */
u32 kwmpp_config[] = {
MPP0_SPI_SCn, /* SPI Flash */
MPP1_SPI_MOSI,
MPP2_SPI_SCK,
MPP3_SPI_MISO,
MPP4_NF_IO6,
MPP5_NF_IO7,
MPP6_SYSRST_OUTn,
MPP7_GPO,
MPP8_TW_SDA,
MPP9_TW_SCK,
MPP10_UART0_TXD, /* Serial */
MPP11_UART0_RXD,
MPP12_SD_CLK, /* SDIO Slot */
MPP13_SD_CMD,
MPP14_SD_D0,
MPP15_SD_D1,
MPP16_SD_D2,
MPP17_SD_D3,
MPP18_NF_IO0,
MPP19_NF_IO1,
MPP20_GE1_0, /* Gigabit Ethernet */
MPP21_GE1_1,
MPP22_GE1_2,
MPP23_GE1_3,
MPP24_GE1_4,
MPP25_GE1_5,
MPP26_GE1_6,
MPP27_GE1_7,
MPP28_GE1_8,
MPP29_GE1_9,
MPP30_GE1_10,
MPP31_GE1_11,
MPP32_GE1_12,
MPP33_GE1_13,
MPP34_GE1_14,
MPP35_GE1_15,
MPP36_GPIO,
MPP37_GPIO,
MPP38_GPIO,
MPP39_GPIO,
MPP40_TDM_SPI_SCK,
MPP41_TDM_SPI_MISO,
MPP42_TDM_SPI_MOSI,
MPP43_GPIO,
MPP44_GPIO,
MPP45_GPIO,
MPP46_GPIO, /* Wifi AP LED */
MPP47_GPIO,
MPP48_GPIO, /* Wifi LED */
It is better if you can comment about rest other GPIOSs with their assigned functionality.
I filled in what I was comfortable labeling, anything else would be a guess on my part. This is a standard kirkwood configuration except for pins 0-3 and the LEDS (46,48). Should I add a comment to the same effect?
My comment was for MPPXX_GPIOs, for rest other macros are enough to explain.
Ahh, The Sheevaplug and the Guruplug had 7 GPIO pins exported to a header on the pcb. I haven't taken apart the dreamplug, but would assume it's the same. Especially since the Global Scale code didn't change it.
MPP47 and MPP49 were LED pins on previous *plugs and appear not to be used in the dreamplug.
I'll locate the header on the pcb and make a comment in the next version. If they are broken out, it would be nice to use the (proposed) gpio cmd on them from within uboot.
MPP49_GPIO,
0
};
kirkwood_mpp_conf(kwmpp_config);
return 0;
+}
+int board_init(void) +{
/*
* arch number of board
* XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline.
*/
gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG;
I think this board should have some delta to guruplug? I think you should have different machine ID here.
See added changelog and patch 5 in the series.
BTW: what is delta w.r.to guruplug?
Just 2MB SPI flash instead of 512MB NAND flash. It grabs the kernel/initrd from an internal microSD card attached via USB, instead of NAND flash. OS is on the same microSD card.
The dreamplug kernel shipped with the device doesn't even see the SPI flash. I think it may be the exact same as the guruplug kernel, although I haven't done a rigorous check. It's built for MACH_TYPE_GURUPLUG, though.
It has some bells and whistles, like audio in/out, SPDIF out. Nothing else really relevant to u-boot.
/* adress of boot parameters */
gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
return 0;
+}
+#ifdef CONFIG_RESET_PHY_R +void mv_phy_88e1121_init(char *name) +{
u16 reg;
u16 devadr;
if (miiphy_set_current_dev(name))
return;
/* command to read PHY dev address */
if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
printf("Err..%s could not read PHY dev address\n",
__FUNCTION__);
return;
}
/*
* Enable RGMII delay on Tx and Rx for CPU port
* Ref: sec 4.7.2 of chip datasheet
*/
miiphy_write(name, devadr, MV88E1121_PGADR_REG, 2);
miiphy_read(name, devadr, MV88E1121_MAC_CTRL2_REG, ®);
reg |= (MV88E1121_RGMII_RXTM_CTRL |
MV88E1121_RGMII_TXTM_CTRL);
miiphy_write(name, devadr, MV88E1121_MAC_CTRL2_REG, reg);
miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0);
/* reset the phy */
miiphy_reset(name, devadr);
printf("88E1116 Initialized on %s\n", name);
Function name and print info are mismatching.
Gah! good catch. I just copied that printf over from the GST source code. I'll fix it up.
+}
+void reset_phy(void) +{
/* configure and initialize both PHY's */
mv_phy_88e1121_init("egiga0");
mv_phy_88e1121_init("egiga1");
+} +#endif /* CONFIG_RESET_PHY_R */ diff --git a/board/Marvell/dreamplug/dreamplug.h b/board/Marvell/dreamplug/dreamplug.h new file mode 100644 index 0000000..21bf644 --- /dev/null +++ b/board/Marvell/dreamplug/dreamplug.h @@ -0,0 +1,42 @@ +/*
- (C) Copyright 2011
- Jason Cooper u-boot@lakedaemon.net
- Based on work by:
- Marvell Semiconductor <www.marvell.com>
- Written-by: Siddarth Gore gores@marvell.com
- 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 __DREAMPLUG_H +#define __DREAMPLUG_H
+#define DREAMPLUG_OE_LOW (~(0)) +#define DREAMPLUG_OE_HIGH (~(0)) +#define DREAMPLUG_OE_VAL_LOW 0 +#define DREAMPLUG_OE_VAL_HIGH (0xf << 16) /* 4 LED Pins high
*/
+/* PHY related */ +#define MV88E1121_MAC_CTRL2_REG 21 +#define MV88E1121_PGADR_REG 22 +#define MV88E1121_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1121_RGMII_RXTM_CTRL (1 << 5)
+#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg
I hope this is not same as guruplug (since you are using same machine-
id)?
Very similar, see above.
We can overrule this at this and can go ahead having dreamplug as new board support since we have valid machin_id for this board.
Okay, I'll go dig up the patch for changing mach-types.h and include it in the next revision.
thx,
Jason.

-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Friday, July 29, 2011 8:49 PM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 4/5 v5] dreamplug: initial board support.
...snip...
+/* PHY related */ +#define MV88E1121_MAC_CTRL2_REG 21 +#define MV88E1121_PGADR_REG 22 +#define MV88E1121_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1121_RGMII_RXTM_CTRL (1 << 5)
+#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg
I hope this is not same as guruplug (since you are using same
machine-
id)?
Very similar, see above.
We can overrule this at this and can go ahead having dreamplug as new board support since we have valid machin_id for this board.
Okay, I'll go dig up the patch for changing mach-types.h and include it in the next revision.
As you said in other email, dreaplug used guruplug machine ID, this is wrong in principle.
Changing machin-types.h is strictly not recommended, it will be NACked. So you have two options. 1. go and register new machin-id for dreamplug (if h/w delta is considerably high) 2. don't add dreamplug as separate board support, add it as new version for guruplug.
Regards.. Prafulla . .

On Fri, Jul 29, 2011 at 11:57:46AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Friday, July 29, 2011 8:49 PM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 4/5 v5] dreamplug: initial board support.
...snip...
+/* PHY related */ +#define MV88E1121_MAC_CTRL2_REG 21 +#define MV88E1121_PGADR_REG 22 +#define MV88E1121_RGMII_TXTM_CTRL (1 << 4) +#define MV88E1121_RGMII_RXTM_CTRL (1 << 5)
+#endif /* __DREAMPLUG_H */ diff --git a/board/Marvell/dreamplug/kwbimage.cfg b/board/Marvell/dreamplug/kwbimage.cfg
I hope this is not same as guruplug (since you are using same
machine-
id)?
Very similar, see above.
We can overrule this at this and can go ahead having dreamplug as new board support since we have valid machin_id for this board.
Okay, I'll go dig up the patch for changing mach-types.h and include it in the next revision.
As you said in other email, dreaplug used guruplug machine ID, this is wrong in principle.
Changing machin-types.h is strictly not recommended, it will be NACked.
Right, this was my understanding. I must've misunderstood you.
So you have two options.
- go and register new machin-id for dreamplug (if h/w delta is
considerably high)
Already did that a while ago. [1] The problem is, Linux controls mach-types.h and linux-arm isn't accepting new boards until they sort themselves out. Hence, why I was trying to establish a migration path.
The Dreamplug *can* use a MACH_TYPE_GURUPLUG kernel (that's what it ships with), but Linux and userspace can't see the SPI flash in this configuration. In order to update uboot or to change uboot config userspace (eg debian) *must* be able to access the SPI flash. That's why I think the new machid is necessary.
Distributions can carry the patches until mainline gets things sorted, so I'm not worried about that (other than the USB bug). I'm concerned about the folks who want to build a newer / custom uboot and put it on an existing system. They will most likely be using the kernel shipped with the Dreamplug, which is MACH_TYPE_GURUPLUG. Merging patches 1/5, 2/5, and 4/5 once in proper form, will allow users to do this.
If the same user wants to access SPI flash from userspace, they can built a kernel.org kernel with my patches [2], and build uboot with patch 5/5 in my series to switch over to MACH_TYPE_DREAMPLUG.
I know it's complicated, thanks for bearing with me. I haven't been able to find any recommendations by the linux-arm folks as far as what devs with new boards should be doing. I did just find [3] where Arnd Bergmann pushed a couple new boards upstream. I'll do some more research...
thx,
Jason.
[1] http://www.arm.linux.org.uk/developer/machines/list.php?id=3550
*** Old version of patch! *** [2] https://patchwork.kernel.org/patch/879982/ [3] http://lkml.org/lkml/2011/7/26/430

Dear Jason Cooper,
In message 1311715171-13128-4-git-send-email-u-boot@lakedaemon.net you wrote:
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
...
- /* command to read PHY dev address */
- if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
printf("Err..%s could not read PHY dev address\n",
__FUNCTION__);
Checkpatch says:
WARNING: __func__ should be used instead of gcc specific __FUNCTION__
Best regards,
Wolfgang Denk

Wolfgang,
On Thu, Oct 06, 2011 at 08:15:28PM +0200, Wolfgang Denk wrote:
In message 1311715171-13128-4-git-send-email-u-boot@lakedaemon.net you wrote:
Copied wholeheartedly from board/Marvell/guruplug and modified to add support for SPI NOR flash.
...
- /* command to read PHY dev address */
- if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
printf("Err..%s could not read PHY dev address\n",
__FUNCTION__);
Checkpatch says:
WARNING: __func__ should be used instead of gcc specific __FUNCTION__
This is an old version of this patch. v8 is currently in Prafulla's u-boot-marvell git tree. It's fixed in there.
thx,
Jason.

Signed-off-by: Jason Cooper u-boot@lakedaemon.net --- board/Marvell/dreamplug/dreamplug.c | 7 ++----- include/configs/dreamplug.h | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/board/Marvell/dreamplug/dreamplug.c b/board/Marvell/dreamplug/dreamplug.c index cdc094a..f848db7 100644 --- a/board/Marvell/dreamplug/dreamplug.c +++ b/board/Marvell/dreamplug/dreamplug.c @@ -104,11 +104,8 @@ int board_early_init_f(void)
int board_init(void) { - /* - * arch number of board - * XXX: change to MACH_TYPE_DREAMPLUG once in Linux mainline. - */ - gd->bd->bi_arch_number = MACH_TYPE_GURUPLUG; + /* arch number of board */ + gd->bd->bi_arch_number = MACH_TYPE_DREAMPLUG;
/* adress of boot parameters */ gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h index 2a908f4..4be2e59 100644 --- a/include/configs/dreamplug.h +++ b/include/configs/dreamplug.h @@ -39,7 +39,7 @@ #define CONFIG_SHEEVA_88SV131 1 /* CPU Core subversion */ #define CONFIG_KIRKWOOD 1 /* SOC Family Name */ #define CONFIG_KW88F6281 1 /* SOC Name */ -#define CONFIG_MACH_GURUPLUG /* Machine type */ +#define CONFIG_MACH_DREAMPLUG /* Machine type */ #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
/*

-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG
Sorry about my related comments in patch 4/5, you can merge this patch to 4/5 to avoid confusion.
Regards.. Prafulla . .

On Wed, Jul 27, 2011 at 11:40:27AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG
Sorry about my related comments in patch 4/5, you can merge this patch to 4/5 to avoid confusion.
See my comments in my reply to 4/5. I'd like (if possible) to get this merged before h*ll freezes over (Linux arm tree cleaned up). So, I'm trying to break the patch up into logical migration pieces.
Since every Dreamplug on the market sets and uses MACH_TYPE_GURUPLUG, I think it's reasonable to use it (hopefully merged into u-boot) until the linux-arm tree gets sorted out and they accept new boards / machids. Then, the last patch can be added.
Am I way off base with that idea?
thx,
Jason.

On Wed, 27 Jul 2011 22:08:23 -0400, Jason u-boot@lakedaemon.net wrote:
Since every Dreamplug on the market sets and uses MACH_TYPE_GURUPLUG, I think it's reasonable to use it (hopefully merged into u-boot) until the linux-arm tree gets sorted out and they accept new boards / machids. Then, the last patch can be added.
If we're going to re-flash a bunch of Dreamplug units with new u-boot, I'd prefer we go ahead and set a new id. If that means we have to carry around a local kernel patch for a while until the new id gets merged into the kernel.org tree, that seems much easier to cope with than having to flash yet another new u-boot later?
Bdale

On Thu, Jul 28, 2011 at 09:25:48AM +0200, Bdale Garbee wrote:
On Wed, 27 Jul 2011 22:08:23 -0400, Jason u-boot@lakedaemon.net wrote:
Since every Dreamplug on the market sets and uses MACH_TYPE_GURUPLUG, I think it's reasonable to use it (hopefully merged into u-boot) until the linux-arm tree gets sorted out and they accept new boards / machids. Then, the last patch can be added.
If we're going to re-flash a bunch of Dreamplug units with new u-boot, I'd prefer we go ahead and set a new id. If that means we have to carry around a local kernel patch for a while until the new id gets merged into the kernel.org tree, that seems much easier to cope with than having to flash yet another new u-boot later?
I agree, which is why I included patch 5. I've rebased my Linux dreamplug patches against v3.0 and am doing some testing, Hopefully I can push those out this weekend. I'll add you folks to the CC when I do that.
Do you think Linus, GregKH and others would flip if I suggested arch/arm/staging/* ? ;-)
thx,
Jason.

On Thu, 28 Jul 2011 08:43:53 -0400, Jason u-boot@lakedaemon.net wrote:
I agree, which is why I included patch 5. I've rebased my Linux dreamplug patches against v3.0 and am doing some testing, Hopefully I can push those out this weekend. I'll add you folks to the CC when I do that.
Great, I'll look forward to them. We're getting dangerously close to having all the right bits in hand to issue an initial developer's image for the Dreamplug on behalf of the FreedomBox Foundation. Really appreciate your timely help with this part!
Do you think Linus, GregKH and others would flip if I suggested arch/arm/staging/* ? ;-)
;-)
Bdale

-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Thursday, July 28, 2011 7:38 AM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG
On Wed, Jul 27, 2011 at 11:40:27AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;
Siddarth
Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG
Sorry about my related comments in patch 4/5, you can merge this patch to 4/5 to avoid confusion.
See my comments in my reply to 4/5. I'd like (if possible) to get this merged before h*ll freezes over (Linux arm tree cleaned up). So, I'm trying to break the patch up into logical migration pieces.
Since every Dreamplug on the market sets and uses MACH_TYPE_GURUPLUG, I think it's reasonable to use it (hopefully merged into u-boot) until the linux-arm tree gets sorted out and they accept new boards / machids. Then, the last patch can be added.
Am I way off base with that idea?
So this is gating to provide dreamplug as separate board support or anther version for guruplug.
Regards.. Prafulla . .

On Thu, Jul 28, 2011 at 12:39:02PM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason [mailto:u-boot@lakedaemon.net] Sent: Thursday, July 28, 2011 7:38 AM To: Prafulla Wadaskar Cc: clint@debian.org; wd@denx.de; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Siddarth Gore; bdale@gag.com Subject: Re: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG
On Wed, Jul 27, 2011 at 11:40:27AM -0700, Prafulla Wadaskar wrote:
-----Original Message----- From: Jason Cooper [mailto:u-boot@lakedaemon.net] Sent: Wednesday, July 27, 2011 2:49 AM To: clint@debian.org; wd@denx.de; Prafulla Wadaskar Cc: u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare;
Siddarth
Gore; bdale@gag.com; Jason Cooper Subject: RFC [PATCH 5/5 v5] dreamplug: use MACH_TYPE_DREAMPLUG
Sorry about my related comments in patch 4/5, you can merge this patch to 4/5 to avoid confusion.
See my comments in my reply to 4/5. I'd like (if possible) to get this merged before h*ll freezes over (Linux arm tree cleaned up). So, I'm trying to break the patch up into logical migration pieces.
Since every Dreamplug on the market sets and uses MACH_TYPE_GURUPLUG, I think it's reasonable to use it (hopefully merged into u-boot) until the linux-arm tree gets sorted out and they accept new boards / machids. Then, the last patch can be added.
Am I way off base with that idea?
So this is gating to provide dreamplug as separate board support or anther version for guruplug.
Separate board support. I'm trying to work around the fact that GlobalScale _didn't_ request / use a separate machid when they should have. They just reused MACH_TYPE_GURUPLUG. :-(
thx,
Jason.
participants (10)
-
Albert ARIBAUD
-
Bdale Garbee
-
Clint Adams
-
Igor Grinberg
-
Jason
-
Jason
-
Jason Cooper
-
Prafulla Wadaskar
-
u-boot@lakedaemon.net
-
Wolfgang Denk