[U-Boot] [PATCH/RFC 2/2]: arm: Kirkwood: Support for the OpenRD base board
Prafulla Wadaskar
prafulla at marvell.com
Fri Jul 3 06:14:43 CEST 2009
> -----Original Message-----
> From: u-boot-bounces at lists.denx.de
> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Simon Kagstrom
> Sent: Thursday, July 02, 2009 6:50 PM
> To: U-Boot ML
> Subject: [U-Boot] [PATCH/RFC 2/2]: arm: Kirkwood: Support for
> the OpenRD base board
>
> Support for the OpenRD base board
>
> The implementation is borrowed from the sheevaplug board and
> the Marvell
> 1.1.4 code and likely to be a bit incomplete. GPIO pins are
> configured, but not really tested.
>
> Signed-off-by: Simon Kagstrom <simon.kagstrom at netinsight.net>
> ---
> Makefile | 3 +
> board/Marvell/openrd_base/Makefile | 51 ++++++++
> board/Marvell/openrd_base/config.mk | 25 ++++
> board/Marvell/openrd_base/openrd_base.c | 129 +++++++++++++++++++
> board/Marvell/openrd_base/openrd_base.h | 42 ++++++
> include/asm-arm/arch-kirkwood/mpp.h | 2 +-
Please remove mpp patch, it is already accepted on arm/next
> include/asm-arm/mach-types.h | 13 ++
First register board id with armlinux and then use it.
> include/configs/openrd_base.h | 210
> +++++++++++++++++++++++++++++++
Maintainer and MAKEALL entries missing , refer development guidelines
> 8 files changed, 474 insertions(+), 1 deletions(-) create
> diff --git a/board/Marvell/openrd_base/Makefile
> b/board/Marvell/openrd_base/Makefile
> new file mode 100644
> index 0000000..42c0842
> --- /dev/null
> +++ b/board/Marvell/openrd_base/Makefile
> @@ -0,0 +1,51 @@
> +#
> +# (C) Copyright 2009
> +# Marvell Semiconductor <www.marvell.com> # Written-by: Prafulla
> +Wadaskar <prafulla at 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).a
> +
> +COBJS := openrd_base.o ../common/mv881116.o
This is not yet accepted driver, use it as a part of board specific code, refer sheevaplug.c
> diff --git a/board/Marvell/openrd_base/openrd_base.c
> b/board/Marvell/openrd_base/openrd_base.c
> new file mode 100644
> index 0000000..5a15091
> --- /dev/null
> +++ b/board/Marvell/openrd_base/openrd_base.c
> @@ -0,0 +1,129 @@
> +/*
> + * (C) Copyright 2009
> + * Marvell Semiconductor <www.marvell.com>
> + * Written-by: Simon Kagstrom <simon.kagstrom at netinsight.net>
> + * Based on sheevaplug.c written-by Prafulla Wadaskar
> +<prafulla at 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 "openrd_base.h"
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +int board_init(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(OPENRD_OE_VAL_LOW,
> + OPENRD_OE_VAL_HIGH,
> + OPENRD_OE_LOW, OPENRD_OE_HIGH);
> +
> + /* Multi-Purpose Pins Functionality configuration */
> + u32 kwmpp_config[] = {
> + MPP0_NF_IO2,
> + MPP1_NF_IO3,
> + MPP2_NF_IO4,
> + MPP3_NF_IO5,
> + MPP4_NF_IO6,
> + MPP5_NF_IO7,
> + MPP6_SYSRST_OUTn,
> + MPP7_GPO,
> + MPP8_TW_SDA,
> + MPP9_TW_SCK,
> + MPP10_UART0_TXD,
> + MPP11_UART0_RXD,
> + MPP12_SD_CLK,
> + MPP13_SD_CMD,
> + MPP14_SD_D0,
> + MPP15_SD_D1,
> + MPP16_SD_D2,
> + MPP17_SD_D3,
> + MPP18_NF_IO0,
> + MPP19_NF_IO1,
> + MPP20_GE1_0,
> + MPP21_GE1_1,
> + MPP22_GE1_2,
> + MPP23_GE1_3,
> + MPP24_GE1_4,
> + MPP25_GE1_5,
> + MPP26_GE1_6,
> + MPP27_GE1_7,
> + MPP28_GPIO,
> + MPP29_TSMP9,
> + MPP30_GE1_10,
> + MPP31_GE1_11,
> + MPP32_GE1_12,
> + MPP33_GE1_13,
> + MPP34_GPIO,
> + MPP35_TDM_CH0_TX_QL,
> + MPP36_TDM_SPI_CS1,
> + MPP37_TDM_CH2_TX_QL,
> + MPP38_TDM_CH2_RX_QL,
> + MPP39_AUDIO_I2SBCLK,
> + MPP40_AUDIO_I2SDO,
> + MPP41_AUDIO_I2SLRC,
> + MPP42_AUDIO_I2SMCLK,
> + MPP43_AUDIO_I2SDI,
> + MPP44_AUDIO_EXTCLK,
> + MPP45_TDM_PCLK,
> + MPP46_TDM_FS,
> + MPP47_TDM_DRX,
> + MPP48_TDM_DTX,
> + MPP49_TDM_CH0_RX_QL,
> + 0
> + };
> + kirkwood_mpp_conf(kwmpp_config);
> +
> + /*
> + * arch number of board
> + */
> + gd->bd->bi_arch_number = MACH_TYPE_OPENRD_BASE;
> +
> + /* adress of boot parameters */
> + gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
> +
> + return 0;
> +}
> +
> +int dram_init(void)
> +{
> + int i;
> +
> + for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
> + gd->bd->bi_dram[i].start = kw_sdram_bar(i);
> + gd->bd->bi_dram[i].size = kw_sdram_bs(i);
> + }
> + return 0;
> +}
> +
> +#ifdef CONFIG_RESET_PHY_R
> +void reset_phy(void)
> +{
> + /* Configure and enable MV88E1116 PHY */
> + mv881116_reset_phy("egiga0");
> +}
> +#endif /* CONFIG_RESET_PHY_R */
> diff --git a/board/Marvell/openrd_base/openrd_base.h
> b/board/Marvell/openrd_base/openrd_base.h
> new file mode 100644
> index 0000000..8463eae
> --- /dev/null
> +++ b/board/Marvell/openrd_base/openrd_base.h
> @@ -0,0 +1,42 @@
> +/*
> + * (C) Copyright 2009
> + * Marvell Semiconductor <www.marvell.com>
> + * Written-by: Simon Kagstrom <simon.kagstrom at netinsight.net>
> + * Based on sheevaplug.h written-by Prafulla Wadaskar
> +<prafulla at 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 __OPENRD_BASE_H
> +#define __OPENRD_BASE_H
> +
> +#define OPENRD_OE_LOW (~(1<<28))
> +#define OPENRD_OE_HIGH (~(1<<2))
> +#define OPENRD_OE_VAL_LOW (0)
> +#define OPENRD_OE_VAL_HIGH (1 << 2)
> +
> +/* PHY related */
> +#define MV88E1116_LED_FCTRL_REG 10
> +#define MV88E1116_CPRSP_CR3_REG 21
> +#define MV88E1116_MAC_CTRL_REG 21
> +#define MV88E1116_PGADR_REG 22
> +#define MV88E1116_RGMII_TXTM_CTRL (1 << 4)
> +#define MV88E1116_RGMII_RXTM_CTRL (1 << 5)
> +
> +#endif /* __OPENRD_BASE_H */
> diff --git a/include/asm-arm/arch-kirkwood/mpp.h
> b/include/asm-arm/arch-kirkwood/mpp.h
> index e021a80..bc74278 100644
> --- a/include/asm-arm/arch-kirkwood/mpp.h
> +++ b/include/asm-arm/arch-kirkwood/mpp.h
Remove..
> diff --git a/include/asm-arm/mach-types.h
> b/include/asm-arm/mach-types.h index 9b8485d..bbea2de 100644
> --- a/include/asm-arm/mach-types.h
> +++ b/include/asm-arm/mach-types.h
> @@ -2120,6 +2120,7 @@ extern unsigned int __machine_arch_type;
> #define MACH_TYPE_FMZWEBMODUL 2134
> #define MACH_TYPE_RD78X00_MASA 2135
> #define MACH_TYPE_SMALLOGGER 2136
> +#define MACH_TYPE_OPENRD_BASE 2261
No changes to this file, it will be imported from linux project so register machine id there..
> diff --git a/include/configs/openrd_base.h
> b/include/configs/openrd_base.h new file mode 100644 index
> 0000000..5bfd689
> --- /dev/null
> +++ b/include/configs/openrd_base.h
> @@ -0,0 +1,210 @@
> +
> +/*
> + * Default environment variables
> + */
> +#define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \
> + "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \
> + "${x_bootcmd_usb}; bootm 0x6400000;"
> +
> +#define CONFIG_MTDPARTS
> "orion_nand:512k(uboot)," \
> + "3m at 1m(kernel),1m at 4m(psm),13m at 5m(rootfs) rw\0"
Do psm needed in your board environment?
Regards..
Prafulla. .
More information about the U-Boot
mailing list