keymile board update
PATCH v4 6/23 mpc832x: add support for the mpc8321 based suvd3 board
In reply to Heiko Schocher- serial console on UART1
- Ethernet RMII over UCC4
- PHY SMSC LAN8700
- 64MB Flash
- 128 MB DDR2 RAM
- I2C
- bootcount
This board is similiar to the kmeter1 (8360) board, so common config options are extracted into the include/configs/km83xx-common.h file.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
Changes for v4:
- addressed comments from Kim Phillips
- replaced 832x and 8360 with just CONFIG_QE
- used (SICRH_UC1EOBI | SICRH_UC2E1OBI) for CONFIG_SYS_SICRH
- Coding Style changes
MAINTAINERS | 1 +
arch/powerpc/cpu/mpc83xx/fdt.c | 3 +-
arch/powerpc/lib/bootcount.c | 2 +-
board/keymile/common/common.c | 10 +-
board/keymile/{kmeter1 => km83xx}/Makefile | 0
.../keymile/{kmeter1/kmeter1.c => km83xx/km83xx.c} | 94 +++++-
boards.cfg | 3 +-
include/configs/km83xx-common.h | 324 +++++++++++++++++++
include/configs/kmeter1.h | 332 +-------------------
include/configs/suvd3.h | 214 +++++++++++++
10 files changed, 640 insertions(+), 343 deletions(-)
rename board/keymile/{kmeter1 => km83xx}/Makefile (100%)
rename board/keymile/{kmeter1/kmeter1.c => km83xx/km83xx.c} (67%)
create mode 100644 include/configs/km83xx-common.h
create mode 100644 include/configs/suvd3.hMAINTAINERS +1 -0
@@ -433,6 +433,7 @@ Heiko Schocher <[email protected]> municse MPC5200 sc3 PPC405GP suen3 ARM926EJS (Kirkwood SoC) + suvd3 MPC8321 uc101 MPC5200 ve8313 MPC8313
arch/powerpc/cpu/mpc83xx/fdt.c +2 -1
@@ -32,7 +32,8 @@ extern void ft_qe_setup(void *blob);DECLARE_GLOBAL_DATA_PTR ; -#if defined(CONFIG_BOOTCOUNT_LIMIT ) && defined(CONFIG_MPC8360 ) +#if defined(CONFIG_BOOTCOUNT_LIMIT ) && \ + (defined(CONFIG_QE ))#include <asm/immap_qe.h> void fdt_fixup_muram (void *blob)
arch/powerpc/lib/bootcount.c +1 -1
@@ -51,7 +51,7 @@#define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_IMMR + CPM_BOOTCOUNT_ADDR)#endif /* defined(CONFIG_MPC8260) */ -#if defined(CONFIG_MPC8360 ) +#if defined(CONFIG_QE )#include <asm/immap_qe.h> #define CONFIG_SYS_BOOTCOUNT_ADDR (CONFIG_SYS_IMMR + 0x110000 + \
board/keymile/common/common.c +6 -4
@@ -29,6 +29,7 @@#include <malloc.h> #include <hush.h> #include <net.h> +#include <netdev.h> #include <asm/io.h> #if defined(CONFIG_OF_BOARD_SETUP ) && defined(CONFIG_OF_LIBFDT )
@@ -402,7 +403,7 @@ static void setports(int gpio)#endif #endif -#if !defined(CONFIG_KMETER1 ) +#if !defined(CONFIG_MPC83xx)static void writeStartSeq (void ) {set_sda (1 );
@@ -461,7 +462,7 @@ static int i2c_make_abort(void)*/ void i2c_init_board (void ) { -#if defined(CONFIG_KMETER1 ) +#if defined(CONFIG_MPC83xx)struct fsl_i2c *dev; dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR +CONFIG_SYS_I2C_OFFSET );uchar dummy;
@@ -573,6 +574,7 @@ int board_eth_init(bd_t *bis) (void )keymile_hdlc_enet_initialize (bis);#endif if (ethernet_present ()) -return -1 ; -return 0 ; +return cpu_eth_init (bis); + +return -1 ; }
board/keymile/km83xx/Makefile renamed from board/keymile/kmeter1/Makefile +0 -0
board/keymile/km83xx/km83xx.c renamed from board/keymile/kmeter1/kmeter1.c +76 -18
151 lines not on this page · raw message
boards.cfg +2 -1
@@ -470,10 +470,11 @@ MPC8360ERDK_66 powerpc mpc83xx mpc8360erdk freesca MPC837XEMDS powerpc mpc83xx mpc837xemds freescale - MPC837XEMDS MPC837XEMDS_HOST powerpc mpc83xx mpc837xemds freescale - MPC837XEMDS:PCI MPC837XERDB powerpc mpc83xx mpc837xerdb freescale -kmeter1 powerpc mpc83xx kmeter1 keymile +kmeter1 powerpc mpc83xx km83xx keymile MVBLM7 powerpc mpc83xx mvblm7 matrix_vision SIMPC8313_LP powerpc mpc83xx simpc8313 sheldon - SIMPC8313:NAND_LP SIMPC8313_SP powerpc mpc83xx simpc8313 sheldon - SIMPC8313:NAND_SP +suvd3 powerpc mpc83xx km83xx keymile TQM834x powerpc mpc83xx tqm834x tqc sbc8540 powerpc mpc85xx sbc8560 - - SBC8540 sbc8540_33 powerpc mpc85xx sbc8560 - - SBC8540
include/configs/km83xx-common.h new file +324 -0
324 lines not on this page · raw message
include/configs/kmeter1.h +14 -318
396 lines not on this page · raw message
include/configs/suvd3.h new file +214 -0
214 lines not on this page · raw message
Signature · 1 line
1.7.4
PATCH v4 6/23 mpc832x: add support for the mpc8321 based suvd3 board
Quoted 12 lines · On Fri, 1 Apr 2011 09:16:18 +0200 Heiko Schocher <[email protected]> wrote:
- serial console on UART1
- Ethernet RMII over UCC4
- PHY SMSC LAN8700
- 64MB Flash
- 128 MB DDR2 RAM
- I2C
- bootcountThis board is similiar to the kmeter1 (8360) board, so common config options are extracted into the
include/configs/km83xx-common.hfile.
Quoted 5 lines
Signed-off-by Heiko Schocher <[email protected]>cc Kim Phillips <[email protected]>cc Holger Brunck <[email protected]>cc Valentin Longchamp <[email protected]>---
Kim
PATCH v4 7/23 mpc832x: add support for mpc8321 based tuxa1 board
In reply to Heiko SchocherThis board is similar to suvd3 board. So most initialisation topics are taken from suvd3 (UART1, Ethernet, piggy PHY, flash, ram) only the application specific chip selects differ.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
Changes for v4:
- addressed comment from Kim Phillips:
- Codingsytle changes
- removed CONFIG_SYS_SICRH define, as it not exists on 832x
MAINTAINERS | 1 + boards.cfg | 1 + include/configs/tuxa1.h | 233 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 235 insertions(+), 0 deletions(-) create mode 100644 include/configs/tuxa1.h
MAINTAINERS +1 -0
@@ -434,6 +434,7 @@ Heiko Schocher <[email protected]> sc3 PPC405GP suen3 ARM926EJS (Kirkwood SoC) suvd3 MPC8321 + tuxa1 MPC8321 uc101 MPC5200 ve8313 MPC8313
boards.cfg +1 -0
@@ -476,6 +476,7 @@ SIMPC8313_LP powerpc mpc83xx simpc8313 sheldon SIMPC8313_SP powerpc mpc83xx simpc8313 sheldon - SIMPC8313:NAND_SP suvd3 powerpc mpc83xx km83xx keymile TQM834x powerpc mpc83xx tqm834x tqc +tuxa1 powerpc mpc83xx km83xx keymile sbc8540 powerpc mpc85xx sbc8560 - - SBC8540 sbc8540_33 powerpc mpc85xx sbc8560 - - SBC8540 sbc8540_66 powerpc mpc85xx sbc8560 - - SBC8540
include/configs/tuxa1.h new file +233 -0
233 lines not on this page · raw message
Signature · 1 line
1.7.4
PATCH v4 7/23 mpc832x: add support for mpc8321 based tuxa1 board
Quoted 10 lines · On Fri, 1 Apr 2011 09:16:19 +0200 Heiko Schocher <[email protected]> wrote:
This board is similar to suvd3 board. So most initialisation topics are taken from suvd3 (UART1, Ethernet, piggy PHY, flash, ram) only the application specific chip selects differ.
Signed-off-by Lukas Roggli <[email protected]>Signed-off-by Holger Brunck <[email protected]>Signed-off-by Heiko Schocher <[email protected]>cc Kim Phillips <[email protected]>cc Valentin Longchamp <[email protected]>---
Kim
PATCH v4 8/23 mpc832x: add support for mpc8321 based tuda1 board
In reply to Heiko SchocherThis board is similar to suvd3 board. So most initialisation topics are taken from suvd3 (UART1, Ethernet, piggy PHY, flash, ram) only the application specific chip selects differ.
---
changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
Changes for v4:
- addressed comment from Kim Phillips:
- Codingsytle changes
- removed CONFIG_SYS_SICRH define, as it not exists
on 832x
MAINTAINERS | 1 + boards.cfg | 1 + include/configs/tuda1.h | 248 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+), 0 deletions(-) create mode 100644 include/configs/tuda1.h
MAINTAINERS +1 -0
@@ -434,6 +434,7 @@ Heiko Schocher <[email protected]> sc3 PPC405GP suen3 ARM926EJS (Kirkwood SoC) suvd3 MPC8321 + tuda1 MPC8321 tuxa1 MPC8321 uc101 MPC5200 ve8313 MPC8313
boards.cfg +1 -0
@@ -476,6 +476,7 @@ SIMPC8313_LP powerpc mpc83xx simpc8313 sheldon SIMPC8313_SP powerpc mpc83xx simpc8313 sheldon - SIMPC8313:NAND_SP suvd3 powerpc mpc83xx km83xx keymile TQM834x powerpc mpc83xx tqm834x tqc +tuda1 powerpc mpc83xx km83xx keymile tuxa1 powerpc mpc83xx km83xx keymile sbc8540 powerpc mpc85xx sbc8560 - - SBC8540 sbc8540_33 powerpc mpc85xx sbc8560 - - SBC8540
include/configs/tuda1.h new file +248 -0
248 lines not on this page · raw message
Signature · 1 line
1.7.4
PATCH v4 8/23 mpc832x: add support for mpc8321 based tuda1 board
Quoted 10 lines · On Fri, 1 Apr 2011 09:16:20 +0200 Heiko Schocher <[email protected]> wrote:
This board is similar to suvd3 board. So most initialisation topics are taken from suvd3 (UART1, Ethernet, piggy PHY, flash, ram) only the application specific chip selects differ.
Signed-off-by Lukas Roggli <[email protected]>Signed-off-by Holger Brunck <[email protected]>Signed-off-by Heiko Schocher <[email protected]>cc Kim Phillips <[email protected]>cc Valentin Longchamp <[email protected]>---
Kim
PATCH v4 9/23 arm: add support for kirkwood based mgcoge2un board
In reply to Heiko SchocherThis board is similar to keymile suen3.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
MAINTAINERS | 1 + boards.cfg | 1 + include/configs/km_arm.h | 41 ++++++++++++++++++++++++++++ include/configs/mgcoge2un.h | 63 +++++++++++++++++++++++++++++++++++++++++++ include/configs/suen3.h | 41 ---------------------------- 5 files changed, 106 insertions(+), 41 deletions(-) create mode 100644 include/configs/mgcoge2un.h
MAINTAINERS +1 -0
@@ -428,6 +428,7 @@ Heiko Schocher <[email protected]> jupiter MPC5200 kmeter1 MPC8360 mgcoge MPC8247 + mgcoge2un ARM926EJS (Kirkwood SoC) mucmc52 MPC5200 muas3001 MPC8270 municse MPC5200
boards.cfg +1 -0
@@ -94,6 +94,7 @@ davinci_schmoogie arm arm926ejs schmoogie davinci davinci_sffsdr arm arm926ejs sffsdr davinci davinci davinci_sonata arm arm926ejs sonata davinci davinci suen3 arm arm926ejs km_arm keymile kirkwood +mgcoge2un arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood openrd_base arm arm926ejs - Marvell kirkwood
include/configs/km_arm.h +41 -0
47 lines not on this page · raw message
include/configs/mgcoge2un.h new file +63 -0
63 lines not on this page · raw message
include/configs/suen3.h +0 -41
47 lines not on this page · raw message
Signature · 1 line
1.7.4
PATCH v4 10/23 arm: add support of Kirkwood based board SUEN8
In reply to Heiko SchocherThe Kirwood based SUEN8 board from Keymile is at this stage the same than the suen3 board. This patch adds the board support for the suen8.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
MAINTAINERS | 1 + boards.cfg | 1 + include/configs/suen8.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 0 deletions(-) create mode 100644 include/configs/suen8.h
MAINTAINERS +1 -0
@@ -434,6 +434,7 @@ Heiko Schocher <[email protected]> municse MPC5200 sc3 PPC405GP suen3 ARM926EJS (Kirkwood SoC) + suen8 ARM926EJS (Kirkwood SoC) suvd3 MPC8321 tuda1 MPC8321 tuxa1 MPC8321
boards.cfg +1 -0
@@ -94,6 +94,7 @@ davinci_schmoogie arm arm926ejs schmoogie davinci davinci_sffsdr arm arm926ejs sffsdr davinci davinci davinci_sonata arm arm926ejs sonata davinci davinci suen3 arm arm926ejs km_arm keymile kirkwood +suen8 arm arm926ejs km_arm keymile kirkwood mgcoge2un arm arm926ejs km_arm keymile kirkwood guruplug arm arm926ejs - Marvell kirkwood mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood
include/configs/suen8.h new file +63 -0
63 lines not on this page · raw message
Signature · 1 line
1.7.4
PATCH v4 11/23 ppc: add support for ppc based board mgcoge2ne
In reply to Heiko SchocherThe mgcoge2 board from keymile deploys two different processors. An ARM based Kirkwood for the "unit" part of the SW and a PPC for the "ne" part of the SW. Therefore in Linux and U-Boot the names for the board are mgcoge2un and mgcoge2ne. This patch adds the mgcoge2ne part of the board. The ppc part of mgboge2 is quite similar to mgcoge, therefore a generic header km82xx-common.h was introduced to collect all similiarities. Currently the only difference is that mgcoge2ne has a 64 MB numonyx NOR flash with a single die. The mgcoge has a dual die flash 2*32MB from spansion.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
MAINTAINERS | 1 + board/keymile/common/common.c | 4 +- board/keymile/mgcoge/mgcoge.c | 4 + boards.cfg | 1 + include/configs/km82xx-common.h | 336 +++++++++++++++++++++++++++++++++++++++ include/configs/mgcoge.h | 312 +----------------------------------- include/configs/mgcoge2ne.h | 64 ++++++++ 7 files changed, 411 insertions(+), 311 deletions(-) create mode 100644 include/configs/km82xx-common.h create mode 100644 include/configs/mgcoge2ne.h
MAINTAINERS +1 -0
@@ -428,6 +428,7 @@ Heiko Schocher <[email protected]> jupiter MPC5200 kmeter1 MPC8360 mgcoge MPC8247 + mgcoge2ne MPC8247 mgcoge2un ARM926EJS (Kirkwood SoC) mucmc52 MPC5200 muas3001 MPC8270
board/keymile/common/common.c +2 -2
@@ -22,7 +22,7 @@*/ #include <common.h> -#if defined(CONFIG_MGCOGE ) +#if defined(CONFIG_MGCOGE ) || defined(CONFIG_MGCOGE2NE )#include <mpc8260.h> #endif #include <ioports.h>
@@ -343,7 +343,7 @@ int ivm_read_eeprom(void)#define DELAY_ABORT_SEQ 62#define DELAY_HALF_PERIOD (500 / (CONFIG_SYS_I2C_SPEED / 1000)) -#if defined(CONFIG_MGCOGE ) +#if defined(CONFIG_MGCOGE ) || defined(CONFIG_MGCOGE2NE )#define SDA_MASK 0x00010000#define SCL_MASK 0x00020000static void set_pin (int state,unsigned long mask)
board/keymile/mgcoge/mgcoge.c +4 -0
@@ -284,7 +284,11 @@ phys_size_t initdram(int board_type)int checkboard (void ) { +#if defined(CONFIG_MGCOGE )puts ("Board: Keymile mgcoge" ); +#else +puts ("Board: Keymile mgcoge2ne" ); +#endif if (ethernet_present ())puts (" with PIGGY." );puts ("\n" );
boards.cfg +1 -0
@@ -424,6 +424,7 @@ PQ2FADS-ZU_66MHz_lowboot powerpc mpc8260 mpc8260ads freesca PQ2FADS-ZU_lowboot powerpc mpc8260 mpc8260ads freescale - MPC8260ADS:ADSTYPE=CONFIG_SYS_PQ2FADS,SYS_TEXT_BASE=0xFF800000 VoVPN-GW_66MHz powerpc mpc8260 vovpn-gw funkwerk - VoVPN-GW:CLKIN_66MHz mgcoge powerpc mpc8260 - keymile +mgcoge2ne powerpc mpc8260 mgcoge keymile SCM powerpc mpc8260 - siemens TQM8255_AA powerpc mpc8260 tqm8260 tqc - TQM8260:MPC8255,300MHz TQM8260_AA powerpc mpc8260 tqm8260 tqc - TQM8260:MPC8260,200MHz
include/configs/km82xx-common.h new file +336 -0
336 lines not on this page · raw message
include/configs/mgcoge.h +3 -309
324 lines not on this page · raw message
include/configs/mgcoge2ne.h new file +64 -0
64 lines not on this page · raw message
Signature · 1 line
1.7.4
PATCH v4 12/23 keymile, 8321 boards: move common definitions to km8321-common.h
In reply to Heiko SchocherFrom: Thomas Reufer <[email protected]>
First step for a cleanup of all header files for km8321 boards.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
Changes for v4:
- addressed comment from Kim Phillips:
- Codingsytle changes
- removed CONFIG_SYS_SICRH define, as it not exists on 832x
include/configs/km8321-common.h | 140 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 140 insertions(+), 0 deletions(-) create mode 100644 include/configs/km8321-common.h
include/configs/km8321-common.h new file +140 -0
@@ -0,0 +1,140 @@ +/* +* Copyright (C) 2006 Freescale Semiconductor, Inc. +* Dave Liu <[email protected]> +* +* Copyright (C) 2007 Logic Product Development, Inc. +* Peter Barada <[email protected]> +* +* Copyright (C) 2007 MontaVista Software, Inc. +* Anton Vorontsov <[email protected]> +* +* (C) Copyright 2008 +* Heiko Schocher, DENX Software Engineering, hs at denx.de. +* +* (C) Copyright 2010 +* Lukas Roggli, KEYMILE Ltd, lukas.roggli at keymile.com +* +* (C) Copyright 2010-2011 +* Thomas Reufer, KEYMILE Ltd, thomas.reufer at keymile.com +* +* 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. +*/ + +#ifndef __CONFIG_KM8321_COMMON_H +#define __CONFIG_KM8321_COMMON_H + +/* +* High Level Configuration Options +*/ +#define CONFIG_QE /* Has QE */ +#define CONFIG_MPC832x/* MPC832x CPU specific */ +#define CONFIG_KM8321 /* Keymile PBEC8321 board specific */ + +#define CONFIG_KM_DEF_NETDEV \ + "netdev=eth0\0" + +#define CONFIG_KM_DEF_ROOTPATH \ + "rootpath=/opt/eldk/ppc_8xx\0" + +/* include common defines/options for all 83xx Keymile boards */ +#include "km83xx-common.h" + +#define CONFIG_MISC_INIT_R + +/* +* System IO Config +*/ +#define CONFIG_SYS_SICRL SICRL_IRQ_CKS + +/* +* Hardware Reset Configuration Word +*/ +#define CONFIG_SYS_HRCW_LOW (\ + HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \ + HRCWL_DDR_TO_SCB_CLK_2X1 | \ + HRCWL_CSB_TO_CLKIN_2X1 | \ + HRCWL_CORE_TO_CSB_2_5X1 | \ + HRCWL_CE_PLL_VCO_DIV_2 | \ + HRCWL_CE_TO_PLL_1X3) + +#define CONFIG_SYS_HRCW_HIGH (\ + HRCWH_PCI_AGENT | \ + HRCWH_PCI_ARBITER_DISABLE | \ + HRCWH_CORE_ENABLE | \ + HRCWH_FROM_0X00000100 | \ + HRCWH_BOOTSEQ_DISABLE | \ + HRCWH_SW_WATCHDOG_DISABLE | \ + HRCWH_ROM_LOC_LOCAL_16BIT | \ + HRCWH_BIG_ENDIAN | \ + HRCWH_LALE_NORMAL) + +#define CONFIG_SYS_DDR_CS0_BNDS 0x0000007f +#define CONFIG_SYS_DDR_SDRAM_CFG (SDRAM_CFG_SDRAM_TYPE_DDR2 | \ + SDRAM_CFG_32_BE | \ + SDRAM_CFG_SREN) + +#define CONFIG_SYS_DDR_SDRAM_CFG2 0x00401000 +#define CONFIG_SYS_DDR_CLK_CNTL (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05) +#define CONFIG_SYS_DDR_INTERVAL ((0x064 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \ + (0x200 << SDRAM_INTERVAL_REFINT_SHIFT)) + +#define CONFIG_SYS_DDR_CS0_CONFIG (CSCONFIG_EN | CSCONFIG_AP | \ + CSCONFIG_ODT_WR_CFG | \ + CSCONFIG_ROW_BIT_13 | \ + CSCONFIG_COL_BIT_10) + +#define CONFIG_SYS_DDR_MODE 0x47860252 +#define CONFIG_SYS_DDR_MODE2 0x8080c000 + +#define CONFIG_SYS_DDR_TIMING_0 ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \ + (8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \ + (2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \ + (2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT) | \ + (0 << TIMING_CFG0_WWT_SHIFT) | \ + (0 << TIMING_CFG0_RRT_SHIFT) | \ + (0 << TIMING_CFG0_WRT_SHIFT) | \ + (0 << TIMING_CFG0_RWT_SHIFT)) + +#define CONFIG_SYS_DDR_TIMING_1 ((TIMING_CFG1_CASLAT_50) | \ + (2 << TIMING_CFG1_WRTORD_SHIFT) | \ + (2 << TIMING_CFG1_ACTTOACT_SHIFT) | \ + (2 << TIMING_CFG1_WRREC_SHIFT) | \ + (6 << TIMING_CFG1_REFREC_SHIFT) | \ + (2 << TIMING_CFG1_ACTTORW_SHIFT) | \ + (6 << TIMING_CFG1_ACTTOPRE_SHIFT) | \ + (2 << TIMING_CFG1_PRETOACT_SHIFT)) + +#define CONFIG_SYS_DDR_TIMING_2 ((8 << TIMING_CFG2_FOUR_ACT_SHIFT) | \ + (3 << TIMING_CFG2_CKE_PLS_SHIFT) | \ + (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \ + (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \ + (4 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \ + (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \ + (5 << TIMING_CFG2_CPO_SHIFT)) + +#define CONFIG_SYS_DDR_TIMING_3 0x00000000 + +#define CONFIG_SYS_PIGGY_BASE 0xE8000000 +#define CONFIG_SYS_PIGGY_SIZE 128 + +/* EEprom support */ +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 + +/* +* Local Bus Configuration & Clock Setup +*/ +#define CONFIG_SYS_LCRR (LCRR_DBYP | LCRR_EADC_1 | LCRR_CLKDIV_2) +#define CONFIG_SYS_LBC_LBCR 0x00000000 + +/* +* MMU Setup +*/ +#define CONFIG_SYS_IBAT7L (0) +#define CONFIG_SYS_IBAT7U (0) +#define CONFIG_SYS_DBAT7L CONFIG_SYS_IBAT7L +#define CONFIG_SYS_DBAT7U CONFIG_SYS_IBAT7U + +#endif /* __CONFIG_KM8321_COMMON_H */
Signature · 1 line
1.7.4
PATCH v4 12/23 keymile, 8321 boards: move common definitions to km8321-common.h
Quoted 11 lines · On Fri, 1 Apr 2011 09:16:24 +0200 Heiko Schocher <[email protected]> wrote:
From: Thomas Reufer <[email protected]>
First step for a cleanup of all header files for km8321 boards.
Signed-off-by Thomas Reufer <[email protected]>cc Wolfgang Denk <[email protected]>cc Kim Phillips <[email protected]>cc Valentin Longchamp <[email protected]>cc Holger Brunck <[email protected]>cc Heiko Schocher <[email protected]>---
Kim
PATCH v4 13/23 powerpc, 83xx: add kmsupx5 board support
In reply to Heiko SchocherThe Keymile SUPx5 board series is based on a PBEC8321 but contains an additional PBUS FPGA (LPXF) on local bus CS2.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
Changes for v4:
- addressed comment from Kim Phillips:
- Codingsytle changes
MAINTAINERS | 1 + boards.cfg | 1 + include/configs/kmsupx5.h | 91 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 0 deletions(-) create mode 100644 include/configs/kmsupx5.h
MAINTAINERS +1 -0
@@ -427,6 +427,7 @@ Heiko Schocher <[email protected]> ids8247 MPC8247 jupiter MPC5200 kmeter1 MPC8360 + kmsupx5 MPC8321 mgcoge MPC8247 mgcoge2ne MPC8247 mgcoge2un ARM926EJS (Kirkwood SoC)
boards.cfg +1 -0
@@ -477,6 +477,7 @@ kmeter1 powerpc mpc83xx km83xx keymile MVBLM7 powerpc mpc83xx mvblm7 matrix_vision SIMPC8313_LP powerpc mpc83xx simpc8313 sheldon - SIMPC8313:NAND_LP SIMPC8313_SP powerpc mpc83xx simpc8313 sheldon - SIMPC8313:NAND_SP +kmsupx5 powerpc mpc83xx km83xx keymile suvd3 powerpc mpc83xx km83xx keymile TQM834x powerpc mpc83xx tqm834x tqc tuda1 powerpc mpc83xx km83xx keymile
include/configs/kmsupx5.h new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
1.7.4
PATCH v4 13/23 powerpc, 83xx: add kmsupx5 board support
Quoted 10 lines · On Fri, 1 Apr 2011 09:16:25 +0200 Heiko Schocher <[email protected]> wrote:
The Keymile SUPx5 board series is based on a PBEC8321 but contains an additional PBUS FPGA (LPXF) on local bus CS2.
Signed-off-by Thomas Reufer <[email protected]>Signed-off-by Heiko Schocher <[email protected]>cc Wolfgang Denk <[email protected]>cc Kim Phillips <[email protected]>cc Valentin Longchamp <[email protected]>cc Holger Brunck <[email protected]>---
Kim
PATCH v4 14/23 km-arm: i2c support for suenx based boards
In reply to Heiko SchocherThis patch renames the suen3 defines and functions to KM_KIRKWOOD which is more generic and more precise, because these values and functions where used by all suenX boards and not only suen3.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
board/keymile/km_arm/km_arm.c | 20 ++++++++++---------- include/configs/km_arm.h | 18 +++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-)
board/keymile/km_arm/km_arm.c +10 -10
@@ -95,7 +95,7 @@ u32 kwmpp_config[] = {MPP41_GPIO ,/* Piggy3 LED[4] */ MPP42_GPIO ,/* Piggy3 LED[5] */ MPP43_GPIO ,/* Piggy3 LED[6] */ -MPP44_GPIO ,/* Piggy3 LED[7] */ +MPP44_GPIO ,/* Piggy3 LED[7], BIST_EN_L */ MPP45_GPIO ,/* Piggy3 LED[8] */ MPP46_GPIO ,/* Reserved */ MPP47_GPIO, /* Reserved */
@@ -161,14 +161,14 @@ int board_early_init_f(void)#if defined(CONFIG_SOFT_I2C )/* init the GPIO for I2C Bitbang driver */ -kw_gpio_set_valid (SUEN3_SDA_PIN ,1 ); -kw_gpio_set_valid (SUEN3_SCL_PIN ,1 ); -kw_gpio_direction_output (SUEN3_SDA_PIN ,0 ); -kw_gpio_direction_output (SUEN3_SCL_PIN ,0 ); +kw_gpio_set_valid (KM_KIRKWOOD_SDA_PIN ,1 ); +kw_gpio_set_valid (KM_KIRKWOOD_SCL_PIN ,1 ); +kw_gpio_direction_output (KM_KIRKWOOD_SDA_PIN ,0 ); +kw_gpio_direction_output (KM_KIRKWOOD_SCL_PIN ,0 );#endif #if defined(CONFIG_SYS_EEPROM_WREN ) -kw_gpio_set_valid (SUEN3_ENV_WP ,38 ); -kw_gpio_direction_output (SUEN3_ENV_WP ,1 ); +kw_gpio_set_valid (KM_KIRKWOOD_ENV_WP ,38 ); +kw_gpio_direction_output (KM_KIRKWOOD_ENV_WP ,1 );#endif return 0 ;
@@ -321,15 +321,15 @@ int get_sda(void)int get_scl (void ) { -return (kw_gpio_get_value (SUEN3_SCL_PIN ) ?1 :0 ); +return kw_gpio_get_value (KM_KIRKWOOD_SCL_PIN ) ?1 :0 ; }#endif #if defined(CONFIG_SYS_EEPROM_WREN )int eeprom_write_enable (unsigned dev_addr,int state) { -kw_gpio_set_value (SUEN3_ENV_WP , !state); +kw_gpio_set_value (KM_KIRKWOOD_ENV_WP , !state); -return !kw_gpio_get_value (SUEN3_ENV_WP ); +return !kw_gpio_get_value (KM_KIRKWOOD_ENV_WP ); }#endif
include/configs/km_arm.h +9 -9
@@ -179,15 +179,15 @@ void set_sda (int state);void set_scl (int state);int get_sda (void );int get_scl (void ); -#define SUEN3_SDA_PIN 8 -#define SUEN3_SCL_PIN 9 -#define SUEN3_ENV_WP 38 - -#define I2C_ACTIVE __set_direction(SUEN3_SDA_PIN, 0) -#define I2C_TRISTATE __set_direction(SUEN3_SDA_PIN, 1) -#define I2C_READ (kw_gpio_get_value(SUEN3_SDA_PIN) ? 1 : 0) -#define I2C_SDA (bit) kw_gpio_set_value(SUEN3_SDA_PIN, bit); -#define I2C_SCL (bit) kw_gpio_set_value(SUEN3_SCL_PIN, bit); +#define KM_KIRKWOOD_SDA_PIN 8 +#define KM_KIRKWOOD_SCL_PIN 9 +#define KM_KIRKWOOD_ENV_WP 38 + +#define I2C_ACTIVE __set_direction(KM_KIRKWOOD_SDA_PIN, 0) +#define I2C_TRISTATE __set_direction(KM_KIRKWOOD_SDA_PIN, 1) +#define I2C_READ (kw_gpio_get_value(KM_KIRKWOOD_SDA_PIN) ? 1 : 0) +#define I2C_SDA (bit) kw_gpio_set_value(KM_KIRKWOOD_SDA_PIN, bit) +#define I2C_SCL (bit) kw_gpio_set_value(KM_KIRKWOOD_SCL_PIN, bit)#endif #define I2C_DELAY udelay(3)/* 1/4 I2C clock duration */
Signature · 1 line
1.7.4
PATCH v4 15/23 km_arm: change some register values for SDRAM initialization
In reply to Heiko SchocherThese new values are:
- enables UART0 and UART1 pins in MPP
- define some L2 cache settings
- changes a SDRAM timing to better fit the hardware
- removed three writes that were the same as the reset values
---
Changes for v2:
- nothing
Changes for v3:
- nothing
Changes for v4:
- update commit message
board/keymile/km_arm/kwbimage.cfg | 32 ++++++++++++++++++-------------- 1 files changed, 18 insertions(+), 14 deletions(-)
board/keymile/km_arm/kwbimage.cfg +18 -14
@@ -27,16 +27,18 @@ # Boot Media configurations BOOT_FROM spi # Boot from SPI flash -DATA 0xFFD10000 0x01111111 # MPP Control 0 Register -# bit 3-0: MPPSel0 1, NF_IO[2] -# bit 7-4: MPPSel1 1, NF_IO[3] -# bit 12-8: MPPSel2 1, NF_IO[4] -# bit 15-12: MPPSel3 1, NF_IO[5] +DATA 0xFFD10000 0x01112222 # MPP Control 0 Register +# bit 3-0: MPPSel0 2, NF_IO[2] +# bit 7-4: MPPSel1 2, NF_IO[3] +# bit 12-8: MPPSel2 2, NF_IO[4] +# bit 15-12: MPPSel3 2, NF_IO[5] # bit 19-16: MPPSel4 1, NF_IO[6] # bit 23-20: MPPSel5 1, NF_IO[7] # bit 27-24: MPPSel6 1, SYSRST_O # bit 31-28: MPPSel7 0, GPO[7] +DATA 0xFFD10004 0x03303300 + DATA 0xFFD10008 0x00001100 # MPP Control 2 Register # bit 3-0: MPPSel16 0, GPIO[16] # bit 7-4: MPPSel17 0, GPIO[17]
@@ -48,8 +50,8 @@ DATA 0xFFD10008 0x00001100 # MPP Control 2 Register # bit 31-28: MPPSel23 0, GPIO[23] DATA 0xFFD100E0 0x1B1B1B1B # IO Configuration 0 Register -DATA 0xFFD20134 0xBBBBBBBB # L2 RAM Timing 0 Register -DATA 0xFFD20138 0x00BBBBBB # L2 RAM Timing 1 Register +DATA 0xFFD20134 0x66666666 # L2 RAM Timing 0 Register +DATA 0xFFD20138 0x66666666 # L2 RAM Timing 1 Register DATA 0xFFD20154 0x00000200 # CPU RAM Management Control3 Register DATA 0xFFD2014C 0x00001C00 # CPU RAM Management Control1 Register DATA 0xFFD20148 0x00000001 # CPU RAM Management Control0 Register
@@ -63,7 +65,7 @@ DATA 0xFFD01400 0x43000400 # SDRAM Configuration Register # bit29-26: zero # bit31-30: 01 -DATA 0xFFD01404 0x36343000 # DDR Controller Control Low +DATA 0xFFD01404 0x39543000 # DDR Controller Control Low # bit 3-0: 0 reserved # bit 4: 0=addr/cmd in smame cycle # bit 5: 0=clk is driven during self refresh, we don't care for APX
@@ -75,7 +77,7 @@ DATA 0xFFD01404 0x36343000 # DDR Controller Control Low # bit30-28: 3 required # bit31: 0=no additional STARTBURST delay -DATA 0xFFD01408 0x2302544B # DDR Timing (Low) (active cycles value +1) +DATA 0xFFD01408 0x34136552 # DDR Timing (Low) (active cycles value +1) # bit3-0: TRAS lsbs # bit7-4: TRCD # bit11- 8: TRP
@@ -86,7 +88,7 @@ DATA 0xFFD01408 0x2302544B # DDR Timing (Low) (active cycles value +1) # bit27-24: TRRD # bit31-28: TRTP -DATA 0xFFD0140C 0x00000032 # DDR Timing (High) +DATA 0xFFD0140C 0x00000033 # DDR Timing (High) # bit6-0: TRFC # bit8-7: TR2R # bit10-9: TR2W
@@ -116,8 +118,8 @@ DATA 0xFFD01418 0x00000000 # DDR Operation # bit3-0: 0x0, DDR cmd # bit31-4: 0 required -DATA 0xFFD0141C 0x00000642 # DDR Mode -DATA 0xFFD01420 0x00000040 # DDR Extended Mode +DATA 0xFFD0141C 0x00000652 # DDR Mode +DATA 0xFFD01420 0x00000044 # DDR Extended Mode # bit0: 0, DDR DLL enabled # bit1: 0, DDR drive strenght normal # bit2: 1, DDR ODT control lsd disabled
@@ -140,6 +142,8 @@ DATA 0xFFD01424 0x0000F07F # DDR Controller Control High # bit11 : 0 , 1/4 clock cycle skew disabled for write mesh # bit15-12: 1111 required # bit31-16: 0 required +DATA 0xFFD01428 0x00074510 +DATA 0xFFD0147c 0x00007451 DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 DATA 0xFFD01504 0x07FFFFF1 # CS[0]n Size
@@ -153,7 +157,7 @@ DATA 0xFFD0150C 0x00000000 # CS[1]n Size, window disabled DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled -DATA 0xFFD01494 0x00000000 # DDR ODT Control (Low) +DATA 0xFFD01494 0x00010001 # DDR ODT Control (Low) # bit3-0: 0, ODT0Rd, MODT[0] asserted during read from DRAM CS0 # bit19-16:0, ODT0Wr, MODT[0] asserted during write to DRAM CS0
@@ -162,7 +166,7 @@ DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) # bit3-2: 00, ODT1 controlled by register # bit31-4: zero, required -DATA 0xFFD0149C 0x0000E90F # CPU ODT Control +DATA 0xFFD0149C 0x0000FC11 # CPU ODT Control # bit3-0: F, ODT0Rd, Internal ODT asserted during read from DRAM bank0 # bit7-4: 0, ODT0Wr, Internal ODT asserted during write to DRAM bank0 # bit9-8: 1, ODTEn, never active
Signature · 1 line
1.7.4
PATCH v4 16/23 ppc, 8321: cleanup tuxa1, tuda1 and suvd3 support
In reply to Heiko SchocherFor the kmsupx5 a new header file was introduced km8321-common.h. Now the common stuff from tuxa1, tuda1 and suvd3 was removed and the new header file included.
The defines CONFIG_SYS_PIGGY_BASE and CONFIG_SYS_PIGGY_SIZE are confusing. Because they actually describe the KMBEC FPGA values. The KMBEC FPGA can be PRIO on kmeter1 or upio on mgcoge. Therefore all the defines were renamed.
remove unneeded variable CONFIG_KM_DEF_NETDEV, as it is already declared in keymile-common.h
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
Changes for v4:
- rebased only
board/keymile/common/common.c | 3 +- board/keymile/km83xx/km83xx.c | 3 +- board/keymile/mgcoge/mgcoge.c | 3 +- include/configs/keymile-common.h | 2 +- include/configs/km82xx-common.h | 12 ++-- include/configs/km8321-common.h | 7 +-- include/configs/km83xx-common.h | 19 +++--- include/configs/kmeter1.h | 8 ++- include/configs/suvd3.h | 114 +------------------------------------- include/configs/tuda1.h | 111 +------------------------------------ include/configs/tuxa1.h | 113 +------------------------------------- 11 files changed, 36 insertions(+), 359 deletions(-)
board/keymile/common/common.c +2 -1
@@ -562,7 +562,8 @@ int fdt_get_node_and_value(void *blob,#if !defined(MACH_TYPE_KM_KIRKWOOD )int ethernet_present (void ) { -struct km_bec_fpga *base = (struct km_bec_fpga *)CONFIG_SYS_PIGGY_BASE ; +struct km_bec_fpga *base = + (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE ;return in_8 (&base->bprth) &PIGGY_PRESENT ; }
board/keymile/km83xx/km83xx.c +2 -1
@@ -134,7 +134,8 @@ const uint upma_table[] = {int board_early_init_r (void ) { -struct km_bec_fpga *base = (struct km_bec_fpga *)CONFIG_SYS_PIGGY_BASE ; +struct km_bec_fpga *base = + (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE ;#if defined(CONFIG_SUVD3 )immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ;fsl_lbc_t *lbc = &immap->im_lbc;
board/keymile/mgcoge/mgcoge.c +2 -1
@@ -300,7 +300,8 @@ int checkboard(void)*/ int board_early_init_r (void ) { -struct km_bec_fpga *base = (struct km_bec_fpga *)CONFIG_SYS_PIGGY_BASE ; +struct km_bec_fpga *base = + (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE ;/* setup the UPIOx */ /* General Unit Reset disabled, Flash Bank enabled, UnitLed on */
include/configs/keymile-common.h +1 -1
@@ -102,7 +102,7 @@* driver to set the MAC. */ #define CONFIG_CHECK_ETHERNET_PRESENT -#define CONFIG_SYS_SLOT_ID_BASE CONFIG_SYS_PIGGY_BASE +#define CONFIG_SYS_SLOT_ID_BASE CONFIG_SYS_KMBEC_FPGA_BASE#define CONFIG_SYS_SLOT_ID_OFF (0x07)/* register offset */ #define CONFIG_SYS_SLOT_ID_MASK (0x3f)/* mask for slot ID bits */
include/configs/km82xx-common.h +6 -6
@@ -287,20 +287,20 @@ PSDMR_CL_2)/* -* GPIO/PIGGY on CS3 initialization values +* UPIO FPGA (GPIO/PIGGY) on CS3 initialization values */ -#define CONFIG_SYS_PIGGY_BASE 0x30000000 -#define CONFIG_SYS_PIGGY_SIZE 128 +#define CONFIG_SYS_KMBEC_FPGA_BASE 0x30000000 +#define CONFIG_SYS_KMBEC_FPGA_SIZE 128 -#define CONFIG_SYS_BR3_PRELIM ((CONFIG_SYS_PIGGY_BASE & BRx_BA_MSK) |\ +#define CONFIG_SYS_BR3_PRELIM ((CONFIG_SYS_KMBEC_FPGA_BASE & BRx_BA_MSK) |\ BRx_PS_8 | BRx_MS_GPCM_P | BRx_V) -#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_PIGGY_SIZE) |\ +#define CONFIG_SYS_OR3_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) |\ ORxG_CSNT | ORxG_ACS_DIV2 |\ ORxG_SCY_3_CLK | ORxG_TRLX)/* -* Board FPGA on CS4 initialization values +* BFTICU board FPGA on CS4 initialization values */ #define CONFIG_SYS_FPGA_BASE 0x40000000#define CONFIG_SYS_FPGA_SIZE 1/*1KB*/
include/configs/km8321-common.h +2 -5
@@ -33,9 +33,6 @@#define CONFIG_MPC832x/* MPC832x CPU specific */ #define CONFIG_KM8321 /* Keymile PBEC8321 board specific */ -#define CONFIG_KM_DEF_NETDEV \ - "netdev=eth0\0" -#define CONFIG_KM_DEF_ROOTPATH \ "rootpath=/opt/eldk/ppc_8xx\0"
@@ -117,8 +114,8 @@#define CONFIG_SYS_DDR_TIMING_3 0x00000000 -#define CONFIG_SYS_PIGGY_BASE 0xE8000000 -#define CONFIG_SYS_PIGGY_SIZE 128 +#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000 +#define CONFIG_SYS_KMBEC_FPGA_SIZE 128/* EEprom support */ #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
include/configs/km83xx-common.h +10 -9
@@ -121,13 +121,14 @@/* * PRIO1/PIGGY on the local bus CS1 */ -#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_PIGGY_BASE +/* Window base at flash base */ +#define CONFIG_SYS_LBLAWBAR1_PRELIM CONFIG_SYS_KMBEC_FPGA_BASE#define CONFIG_SYS_LBLAWAR1_PRELIM 0x8000001A/* 128MB window size */ -#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_PIGGY_BASE | \ +#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_KMBEC_FPGA_BASE | \ (1 << BR_PS_SHIFT) | /* 8 bit port size */ \BR_V ) -#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_PIGGY_SIZE) | \ +#define CONFIG_SYS_OR1_PRELIM (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \ OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \ OR_GPCM_SCY_2 | \ OR_GPCM_TRLX | OR_GPCM_EAD)
@@ -212,7 +213,7 @@#if defined(CONFIG_CMD_NAND )#define CONFIG_NAND_KMETER1 #define CONFIG_SYS_MAX_NAND_DEVICE 1 -#define CONFIG_SYS_NAND_BASE CONFIG_SYS_PIGGY_BASE +#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE#endif #if defined(CONFIG_PCI )
@@ -257,11 +258,11 @@#define CONFIG_SYS_DBAT1U CONFIG_SYS_IBAT1U/* PRIO1, PIGGY: icache cacheable, but dcache-inhibit and guarded */ -#define CONFIG_SYS_IBAT2L (CONFIG_SYS_PIGGY_BASE | BATL_PP_10 | \ - BATL_MEMCOHERENCE) -#define CONFIG_SYS_IBAT2U (CONFIG_SYS_PIGGY_BASE | BATU_BL_128M | \ - BATU_VS | BATU_VP) -#define CONFIG_SYS_DBAT2L (CONFIG_SYS_PIGGY_BASE | BATL_PP_10 | \ +#define CONFIG_SYS_IBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_10 | \ + BATL_MEMCOHERENCE) +#define CONFIG_SYS_IBAT2U (CONFIG_SYS_KMBEC_FPGA_BASE | BATU_BL_128M | \ + BATU_VS | BATU_VP) +#define CONFIG_SYS_DBAT2L (CONFIG_SYS_KMBEC_FPGA_BASE | BATL_PP_10 | \ BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)#define CONFIG_SYS_DBAT2U CONFIG_SYS_IBAT2U
include/configs/kmeter1.h +5 -3
@@ -106,9 +106,11 @@#define CONFIG_SYS_DDR_TIMING_3 0x00000000 -#define CONFIG_SYS_PIGGY_BASE 0xE8000000 -#define CONFIG_SYS_PIGGY_SIZE 128 -#define CONFIG_SYS_PAXE_BASE 0xA0000000 +/* PRIO FPGA */ +#define CONFIG_SYS_KMBEC_FPGA_BASE 0xE8000000 +#define CONFIG_SYS_KMBEC_FPGA_SIZE 128 +/* PAXE FPGA */ +#define CONFIG_SYS_PAXE_BASE 0xA0000000#define CONFIG_SYS_PAXE_SIZE 512/* EEprom support */
include/configs/suvd3.h +2 -112
143 lines not on this page · raw message
include/configs/tuda1.h +2 -109
140 lines not on this page · raw message
include/configs/tuxa1.h +2 -111
142 lines not on this page · raw message
Signature · 1 line
1.7.4
PATCH v4 16/23 ppc, 8321: cleanup tuxa1, tuda1 and suvd3 support
Quoted 12 lines · On Fri, 1 Apr 2011 09:16:28 +0200 Heiko Schocher <[email protected]> wrote:
For the kmsupx5 a new header file was introduced
km8321-common.h. Now the common stuff from tuxa1, tuda1 and suvd3 was removed and the new header file included.The defines
CONFIG_SYS_PIGGY_BASEandCONFIG_SYS_PIGGY_SIZEare confusing. Because they actually describe the KMBEC FPGA values. The KMBEC FPGA can be PRIO on kmeter1 or upio on mgcoge. Therefore all the defines were renamed.remove unneeded variable
CONFIG_KM_DEF_NETDEV, as it is already declared inkeymile-common.h
Quoted 6 lines
Signed-off-by Holger Brunck <[email protected]>Signed-off-by Heiko Schocher <[email protected]>cc Kim Phillips <[email protected]>cc Wolfgang Denk <[email protected]>cc Valentin Longchamp <[email protected]>---
Kim
PATCH v4 17/23 keymile, common; fix i2c deblocking support
In reply to Heiko SchocherThis patch fix the i2c deblocking facility with the i2c HW-Controller. The required delays for byte reading, the enhanced criteria for stop the dummy read and required 5 start/stop sequences are added.
Add i2c deblocking before ivm eeprom read.
Improve i2c deblocking sequence by respecting stop hold time.
Cleaned function for deblocking. Have now one function i2c_make_abort() available for bitbang, mpc82xx and mpc83xx harware controller.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
board/keymile/common/common.c | 121 ++++++++++++++++++++++++++++++----------- 1 files changed, 89 insertions(+), 32 deletions(-)
board/keymile/common/common.c +89 -32
@@ -40,6 +40,9 @@ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) #include <i2c.h> +static void i2c_write_start_seq(void); +static int i2c_make_abort(void); + int ivm_calc_crc(unsigned char *buf, int len) { const unsigned short crc_tab[16] = {
@@ -329,8 +332,11 @@ int ivm_read_eeprom(void)if (buf !=NULL ) dev_addr =simple_strtoul ((char *)buf,NULL ,16 ); +/* add deblocking here */ +i2c_make_abort (); + ret =i2c_read (dev_addr,0 ,1 , i2c_buffer, -CONFIG_SYS_IVM_EEPROM_MAX_LEN ); +CONFIG_SYS_IVM_EEPROM_MAX_LEN );if (ret !=0 ) {printf ("Error reading EEprom\n" );return -2 ;
@@ -340,7 +346,7 @@ int ivm_read_eeprom(void) }#if defined(CONFIG_SYS_I2C_INIT_BOARD ) -#define DELAY_ABORT_SEQ 62 +#define DELAY_ABORT_SEQ 62/* @200kHz 9 clocks = 44us, 62us is ok */ #define DELAY_HALF_PERIOD (500 / (CONFIG_SYS_I2C_SPEED / 1000))#if defined(CONFIG_MGCOGE ) || defined(CONFIG_MGCOGE2NE )
@@ -404,7 +410,7 @@ static void setports(int gpio)#endif #if !defined(CONFIG_MPC83xx) -static void writeStartSeq (void ) +static void i2c_write_start_seq (void ) {set_sda (1 );udelay (DELAY_HALF_PERIOD );
@@ -426,6 +432,21 @@ static void writeStartSeq(void)*/ static int i2c_make_abort (void ) { + +#if defined(CONFIG_HARD_I2C ) && !defined(MACH_TYPE_KM_KIRKWOOD ) +immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ; +i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c; + +/* +* disable I2C controller first, otherwhise it thinks we want to +* talk to the slave port... +*/ +clrbits_8 (&i2c->i2c_i2mod,0x01 ); + +/* Set the PortPins to GPIO */ +setports (1 ); +#endif +int scl_state =0 ;int sda_state =0 ;int i =0 ;
@@ -449,57 +470,93 @@ static int i2c_make_abort(void) }if (ret ==0 )for (i =0 ; i <5 ; i++) -writeStartSeq (); +i2c_write_start_seq (); +/* respect stop setup time */ +udelay (DELAY_ABORT_SEQ ); +set_scl (1 ); +udelay (DELAY_ABORT_SEQ ); +set_sda (1 );get_sda (); + +#if defined(CONFIG_HARD_I2C ) +/* Set the PortPins back to use for I2C */ +setports (0 ); +#endif return ret; }#endif -/* -* i2c_init_board - reset i2c bus. When the board is powercycled during a -* bus transfer it might hang; for details see doc/I2C_Edge_Conditions. -*/ -void i2c_init_board (void ) -{#if defined(CONFIG_MPC83xx) +static void i2c_write_start_seq (void ) +{ +struct fsl_i2c *dev; + dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR +CONFIG_SYS_I2C_OFFSET ); +udelay (DELAY_ABORT_SEQ ); +out_8 (&dev->cr, (I2C_CR_MEN |I2C_CR_MSTA )); +udelay (DELAY_ABORT_SEQ ); +out_8 (&dev->cr, (I2C_CR_MEN )); +} + +static int i2c_make_abort (void ) +{struct fsl_i2c *dev; dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR +CONFIG_SYS_I2C_OFFSET );uchar dummy; +uchar last; +int nbr_read =0 ; +int i =0 ; +int ret =0 ; +/* wait after each operation to finsh with a delay */ out_8 (&dev->cr, (I2C_CR_MSTA )); +udelay (DELAY_ABORT_SEQ );out_8 (&dev->cr, (I2C_CR_MEN |I2C_CR_MSTA )); +udelay (DELAY_ABORT_SEQ ); dummy =in_8 (&dev->dr); - dummy =in_8 (&dev->dr); -if (dummy !=0xff ) { - dummy =in_8 (&dev->dr); - } -out_8 (&dev->cr, (I2C_CR_MEN )); -out_8 (&dev->cr,0x00 ); -out_8 (&dev->cr, (I2C_CR_MEN )); -#else -#if defined(CONFIG_HARD_I2C ) && !defined(MACH_TYPE_KM_KIRKWOOD ) -immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ; -i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c; +udelay (DELAY_ABORT_SEQ ); + last =in_8 (&dev->dr); + nbr_read++;/* -* disable I2C controller first, otherwhise it thinks we want to -* talk to the slave port... +* do read until the last bit is 1, but stop if the full eeprom is +* read. */ -clrbits_8 (&i2c->i2c_i2mod,0x01 ); +while (((last &0x01 ) !=0x01 ) && + (nbr_read <CONFIG_SYS_IVM_EEPROM_MAX_LEN )) { +udelay (DELAY_ABORT_SEQ ); + last =in_8 (&dev->dr); + nbr_read++; + } +if ((last &0x01 ) !=0x01 ) + ret =-2 ; +if ((last !=0xff ) || (nbr_read >1 )) +printf ("[INFO] i2c abort after %d bytes (0x%02x)\n" , + nbr_read, last); +udelay (DELAY_ABORT_SEQ ); +out_8 (&dev->cr, (I2C_CR_MEN )); +udelay (DELAY_ABORT_SEQ ); +/* clear status reg */ +out_8 (&dev->sr,0 ); -/* Set the PortPins to GPIO */ -setports (1 ); +for (i =0 ; i <5 ; i++) +i2c_write_start_seq (); +if (ret !=0 ) +printf ("[ERROR] i2c abort failed after %d bytes (0x%02x)\n" , + nbr_read, last); + +return ret; +}#endif +/** +* i2c_init_board - reset i2c bus. When the board is powercycled during a +* bus transfer it might hang; for details see doc/I2C_Edge_Conditions. +*/ +void i2c_init_board (void ) +{/* Now run the AbortSequence() */ i2c_make_abort (); - -#if defined(CONFIG_HARD_I2C ) -/* Set the PortPins back to use for I2C */ -setports (0 ); -#endif -#endif }#endif #endif
Signature · 1 line
1.7.4
PATCH v4 18/23 arm, keymile: updates for the arm based boards from keymile
In reply to Heiko Schocherdefine KM_IVM_BUS and KM_ENV_BUS macros
KM_IVM_BUS is used to define the EEprom_ivm environment variable. These macros allow the reuse of these I2C addresses in other code locations.
remove unneeded code
On first HW versions the BOCO FPGA was behind a MUX device. These HW versions are not supported anymore. And therefore this code can be removed.
added LED initialization for SUEN3
The bootstat LED required to be initialized so to have a green colour after start-up.
define CONFIG_SYS_TEXT_BASE
This is needed by the relocation code and is not the same for our ARM BEC and thus needs to be defined.
remove memsize variable
An environment variable for memsize is not needed. this can be get via the board info struct.
remove unneeded double access to bi_dram[i].size field
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
board/keymile/km_arm/km_arm.c | 38 +++++++++++++++++++++++++++++++------- include/configs/km_arm.h | 1 + include/configs/mgcoge2un.h | 6 ++++-- include/configs/suen3.h | 6 ++++-- include/configs/suen8.h | 6 ++++-- 5 files changed, 44 insertions(+), 13 deletions(-)
board/keymile/km_arm/km_arm.c +31 -7
@@ -41,8 +41,6 @@DECLARE_GLOBAL_DATA_PTR ; -static int io_dev; -/* Multi-Purpose Pins Functionality configuration */ u32 kwmpp_config[] = {MPP0_NF_IO2 ,
@@ -119,15 +117,39 @@ int ethernet_present(void)return ret; } +int initialize_unit_leds (void ) +{ +/* +* init the unit LEDs +* per default they all are +* ok apart from bootstat +* LED connected through BOCO +* BOCO lies at the address 0x10 +* LEDs are in the block CTRL_H (addr 0x02) +* BOOTSTAT LED is the first 0x01 +*/ +#define BOCO 0x10 +#define CTRL_H 0x02 +#define APPLEDMASK 0x01 +uchar buf; + +if (i2c_read (BOCO ,CTRL_H ,1 , &buf,1 ) !=0 ) { +printf ("%s: Error reading Boco\n" , __func__); +return -1 ; + } + buf |=APPLEDMASK ; +if (i2c_write (BOCO ,CTRL_H ,1 , &buf,1 ) !=0 ) { +printf ("%s: Error writing Boco\n" , __func__); +return -1 ; + } +return 0 ; +} +int misc_init_r (void ) { -I2C_MUX_DEVICE *i2cdev;char *str;int mach_type; -/* add I2C Bus for I/O Expander */ - i2cdev =i2c_mux_ident_muxstring ((uchar *)"pca9554a:70:a" ); - io_dev = i2cdev->busid;puts ("Piggy:" );if (ethernet_present () ==0 )puts (" not" );
@@ -139,6 +161,9 @@ int misc_init_r(void)printf ("Overwriting MACH_TYPE with %d!!!\n" , mach_type); gd->bd->bi_arch_number = mach_type; } + +initialize_unit_leds (); +return 0 ; }
@@ -245,7 +270,6 @@ void dram_init_banksize(void)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); gd->bd->bi_dram[i].size =get_ram_size ((long *)kw_sdram_bar (i),kw_sdram_bs (i)); }
include/configs/km_arm.h +1 -0
@@ -49,6 +49,7 @@/* include common defines/options for all Keymile boards */ #include "keymile-common.h" +#define CONFIG_SYS_TEXT_BASE 0x04000000/* code address after reloc */ #define CONFIG_ENV_SIZE (128 << 10)/* NAND chip block size */ #define CONFIG_SYS_MEMTEST_START 0x00400000/* 4M */ #define CONFIG_SYS_MEMTEST_END 0x007fffff/*(_8M -1) */
include/configs/mgcoge2un.h +4 -2
@@ -44,12 +44,14 @@#define CONFIG_HOSTNAME mgcoge2un +#define KM_IVM_BUS "pca9547:70:9"/* I2C2 (Mux-Port 1)*/ +#define KM_ENV_BUS "pca9547:70:d"/* I2C2 (Mux-Port 5)*/ +/* * Default environment variables */ #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_KM_DEF_ENV \ - "memsize=0x8000000\0" \ "newenv=setenv addr 0x100000 && " \ "i2c dev 1; mw.b ${addr} 0 4 && " \ "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR) \
@@ -57,7 +59,7 @@ "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR) \ " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0" \"rootpath=/opt/eldk/arm\0" \ -"EEprom_ivm=pca9547:70:9\0" \ +"EEprom_ivm=" KM_IVM_BUS "\0" \ ""#endif /* _CONFIG_MGCOGE2UN_H */
include/configs/suen3.h +4 -2
@@ -43,12 +43,14 @@#define CONFIG_HOSTNAME suen3 +#define KM_IVM_BUS "pca9544a:70:9"/* I2C2 (Mux-Port 1)*/ +#define KM_ENV_BUS "pca9544a:70:d"/* I2C2 (Mux-Port 5)*/ +/* * Default environment variables */ #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_KM_DEF_ENV \ - "memsize=0x8000000\0" \ "newenv=setenv addr 0x100000 && " \ "i2c dev 1; mw.b ${addr} 0 4 && " \ "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR) \
@@ -56,7 +58,7 @@ "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR) \ " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0" \"rootpath=/opt/eldk/arm\0" \ -"EEprom_ivm=pca9544a:70:9\0" \ +"EEprom_ivm=" KM_IVM_BUS "\0" \ ""#endif /* _CONFIG_SUEN3_H */
include/configs/suen8.h +4 -2
@@ -44,12 +44,14 @@#define CONFIG_HOSTNAME suen8 +#define KM_IVM_BUS "pca9544a:70:9"/* I2C2 (Mux-Port 1)*/ +#define KM_ENV_BUS "pca9544a:70:d"/* I2C2 (Mux-Port 5)*/ +/* * Default environment variables */ #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_KM_DEF_ENV \ - "memsize=0x8000000\0" \ "newenv=setenv addr 0x100000 && " \ "i2c dev 1; mw.b ${addr} 0 4 && " \ "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR) \
@@ -57,7 +59,7 @@ "eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR) \ " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0" \"rootpath=/opt/eldk/arm\0" \ -"EEprom_ivm=pca9544a:70:9\0" \ +"EEprom_ivm=" KM_IVM_BUS "\0" \ ""#endif /* _CONFIG_SUEN8_H */
Signature · 1 line
1.7.4
PATCH v4 19/23 keymile boards: add CONFIG_PIGGY_MAC_ADRESS_OFFSET
In reply to Heiko SchocherNormaly the PIGGY_MAC_ADRESS can be read directly from the IVM on keymile boards. On mgcoge3 it differs. Because there are two piggy boards deployed the second MAC adress must be calculated with the IVM mac adress and an offset. This patch allows to set such a offset in the board config.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3
- rebased
- use %pM in sprintf for mac address handling
as Wolfgang Denk suggested.
board/keymile/common/common.c | 13 +++++++++++++ board/keymile/common/common.h | 4 ++++ 2 files changed, 17 insertions(+), 0 deletions(-)
board/keymile/common/common.c +13 -0
@@ -228,8 +228,21 @@ static int ivm_analyze_block2(unsigned char *buf, int len)/* IVM_MacAddress */ sprintf ((char *)valbuf,"%pM" , buf);ivm_set_value ("IVM_MacAddress" , (char *)valbuf); +/* if an offset is defined, add it */ +#if defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET ) +if (CONFIG_PIGGY_MAC_ADRESS_OFFSET >0 ) { +unsigned long val = (buf[4 ] <<16 ) + (buf[5 ] <<8 ) + buf[6 ]; + + val +=CONFIG_PIGGY_MAC_ADRESS_OFFSET ; + buf[4 ] = (val >>16 ) &0xff ; + buf[5 ] = (val >>8 ) &0xff ; + buf[6 ] = val &0xff ; +sprintf ((char *)valbuf,"%pM" , buf); + } +#endif if (getenv ("ethaddr" ) ==NULL )setenv ((char *)"ethaddr" , (char *)valbuf); +/* IVM_MacCount */ count = (buf[10 ] <<24 ) + (buf[11] << 16) +
board/keymile/common/common.h +4 -0
@@ -39,6 +39,10 @@ struct km_bec_fpga {unsigned char pgy_eth; }; +#if !defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET ) +#define CONFIG_PIGGY_MAC_ADRESS_OFFSET 0 +#endif +int ethernet_present (void );int ivm_read_eeprom (void );
Signature · 1 line
1.7.4
PATCH v4 20/23 keymile, common: add setting of some environment variables
In reply to Heiko SchocherThis patch adds last_stage_init to all keymile boards. And in the last stage init some environment variables for u-boot were set. Currently these are pnvramaddr, pram and var address.
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
board/keymile/common/common.c | 38 +++++++++++++++++++++++++++++++++++++- board/keymile/common/common.h | 1 + board/keymile/km83xx/km83xx.c | 6 ++++++ board/keymile/km_arm/km_arm.c | 6 ++++++ board/keymile/mgcoge/mgcoge.c | 6 ++++++ include/configs/keymile-common.h | 3 +++ include/configs/km_arm.h | 7 +++++++ 7 files changed, 66 insertions(+), 1 deletions(-)
board/keymile/common/common.c +37 -1
@@ -42,6 +42,7 @@static void i2c_write_start_seq (void );static int i2c_make_abort (void ); +DECLARE_GLOBAL_DATA_PTR ;int ivm_calc_crc (unsigned char *buf,int len) {
@@ -73,7 +74,42 @@ int ivm_calc_crc(unsigned char *buf, int len)return crc; } -static int ivm_set_value (char *name,char *value) +/* +* Set Keymile specific environment variables +* Currently only some memory layout variables are calculated here +* ... ------------------------------------------------ +* ... |@rootfsaddr |@pnvramaddr |@varaddr |@reserved |@END_OF_RAM +* ... |<------------------- pram ------------------->| +* ... ------------------------------------------------ +* @END_OF_RAM: denotes the RAM size +* @pnvramaddr: Startadress of pseudo non volatile RAM in hex +* @pram : preserved ram size in k +* @varaddr : startadress for /var mounted into RAM +*/ +int set_km_env (void ) +{ +uchar buf[32 ]; +unsigned int pnvramaddr; +unsigned int pram; +unsigned int varaddr; + + pnvramaddr = gd->ram_size -CONFIG_KM_RESERVED_PRAM -CONFIG_KM_PHRAM + -CONFIG_KM_PNVRAM ; +sprintf ((char *)buf,"0x%x" , pnvramaddr); +setenv ("pnvramaddr" , (char *)buf); + + pram = (CONFIG_KM_RESERVED_PRAM +CONFIG_KM_PHRAM +CONFIG_KM_PNVRAM ) / +0x400 ; +sprintf ((char *)buf,"0x%x" , pram); +setenv ("pram" , (char *)buf); + + varaddr = gd->ram_size -CONFIG_KM_RESERVED_PRAM -CONFIG_KM_PHRAM ; +sprintf ((char *)buf,"0x%x" , varaddr); +setenv ("varaddr" , (char *)buf); +return 0 ; +} + +static int ivm_set_value (char *name,char *value) {char tempbuf[256 ];
board/keymile/common/common.h +1 -0
@@ -50,6 +50,7 @@ int ivm_read_eeprom(void);int keymile_hdlc_enet_initialize (bd_t *bis);#endif +int set_km_env (void ); int fdt_set_node_and_value(void *blob, char *nodename, char *regname,
board/keymile/km83xx/km83xx.c +6 -0
@@ -190,6 +190,12 @@ int misc_init_r(void)return 0 ; } +int last_stage_init (void ) +{ +set_km_env (); +return 0 ; +} +int fixed_sdram (void ) {immap_t *im = (immap_t *)CONFIG_SYS_IMMR ;
board/keymile/km_arm/km_arm.c +6 -0
@@ -212,6 +212,12 @@ int board_init(void)return 0 ; } +int last_stage_init (void ) +{ +set_km_env (); +return 0 ; +} +#if defined(CONFIG_CMD_SF )int do_spi_toggle (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {
board/keymile/mgcoge/mgcoge.c +6 -0
@@ -313,6 +313,12 @@ int board_early_init_r(void)return 0 ; } +int last_stage_init (void ) +{ +set_km_env (); +return 0 ; +} +int hush_init_var (void ) {ivm_read_eeprom ();
include/configs/keymile-common.h +3 -0
@@ -26,6 +26,9 @@/* Do boardspecific init for all boards */ #define CONFIG_BOARD_EARLY_INIT_R +#define CONFIG_LAST_STAGE_INIT + +#define CONFIG_BOOTCOUNT_LIMIT /* * By default kwbimage.cfg from board specific folder is used
include/configs/km_arm.h +7 -0
@@ -254,4 +254,11 @@ int get_scl (void);#define CONFIG_SYS_INIT_SP_ADDR 0xC8012000/* Do early setups now in board_init_f() */ #define CONFIG_BOARD_EARLY_INIT_F + +/* +* resereved pram area at the end of memroy [hex] +* 8Mbytes for switch + 4Kbytes for bootcount +*/ +#define CONFIG_KM_RESERVED_PRAM 0x801000 +#endif /* _CONFIG_KM_ARM_H */
Signature · 1 line
1.7.4
PATCH v4 20/23 keymile, common: add setting of some environment variables
Quoted 10 lines · On Fri, 1 Apr 2011 09:16:32 +0200 Heiko Schocher <[email protected]> wrote:
This patch adds
last_stage_initto all keymile boards. And in the last stage init some environment variables for u-boot were set. Currently these are pnvramaddr, pram and var address.Signed-off-by Holger Brunck <[email protected]>Signed-off-by Heiko Schocher <[email protected]>cc Valentin Longchamp <[email protected]>cc Wolfgang Denk <[email protected]>cc Kim Phillips <[email protected]>---
Kim
PATCH v4 21/23 ppc, arm: rework and enhance keymile-common.h
In reply to Heiko SchocherFrom: Holger Brunck <[email protected]>
Add:
- introduce "bootrunner" environment variable
This allows to execute consecutive different commands specified in the list "subbootcmd". If one command fails the command serie will stop.
- introduce environment variable "develop", "ramfs" and "release" Each variable is one way to boot our linux. "develop" is for development purpose and boots the SW via NFS. "release" is for booting the linux image from flash, "ramfs" allows to load an SW image via tftp into ram and executes from there
- introduce "addmem" variable, this command adds the used memory for linux to the bootargs
- introduce "addvar" variable, this command adress for the /var directory to the kernel command line
- introduce "setramfspram" and "setrootfsaddr" these calculation were done if "ramfs" was used (only for debugging)
- introduce "tftpramfs" used for "ramfs" to load the image into RAM (only for debugging)
Remove unneeded stuff:
- CONFIG_IO_MUXING is obsolete for keymile boards
- CONFIG_KM_DEF_ENV_PRIVATE is also obsolete
- define CONFIG_SYS_TEXT_BASE in board configs only
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
include/configs/keymile-common.h | 163 +++++++++++++++++++++++++++++++------ include/configs/km_arm.h | 2 + 2 files changed, 138 insertions(+), 27 deletions(-)
include/configs/keymile-common.h +136 -27
@@ -40,13 +40,6 @@#endif /* CONFIG_SYS_KWD_CONFIG */ /* -* CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed -*/ -#ifndef CONFIG_SYS_TEXT_BASE -#define CONFIG_SYS_TEXT_BASE 0x00400000 -#endif /* CONFIG_SYS_TEXT_BASE */ - -/* * Command line configuration. */ #include <config_cmd_default.h>
@@ -144,28 +137,16 @@#define CONFIG_MTD_DEVICE #define CONFIG_MTD_CONCAT -/* define this to use the keymile's io muxing feature */ -/*#define CONFIG_IO_MUXING */ - -#ifdef CONFIG_IO_MUXING -#define CONFIG_KM_DEF_ENV_IOMUX \ - "nc=setenv ethact HDLC \0" \ - "nce=setenv ethact SCC \0" \ - "stderr=serial,nc \0" \ - "stdin=serial,nc \0" \ - "stdout=serial,nc \0" \ - "tftpsrcp=69 \0" \ - "tftpdstp=69 \0" -#else #define CONFIG_KM_DEF_ENV_IOMUX \ "stderr=serial \0" \ "stdin=serial \0" \ "stdout=serial \0" -#endif -#ifndef CONFIG_KM_DEF_ENV_PRIVATE -#define CONFIG_KM_DEF_ENV_PRIVATE \ - "kmprivate=empty\0" +/* common powerpc specific env settings */ +#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS +#define CONFIG_KM_DEF_ENV_BOOTPARAMS \ + "bootparams=empty\0" \ + "initial_boot_bank=0\0"#endif #ifndef CONFIG_KM_DEF_NETDEV
@@ -184,17 +165,116 @@#define str (s) #s/* +* bootrunner +* - run all commands in 'subbootcmds' +* - on error, stop running the remaing commands +*/ +#define CONFIG_KM_DEF_ENV_BOOTRUNNER \ + "bootrunner=" \ + "break=0; " \ + "for subbootcmd in ${subbootcmds}; do " \ + "if test ${break} -eq 0; then; " \ + "echo \"[INFO] running \\c\"; " \ + "print ${subbootcmd}; " \ + "run ${subbootcmd} || break=1; " \ + "if test ${break} -eq 1; then; " \ + "echo \"[ERR] failed \\c\"; " \ + "print ${subbootcmd}; " \ + "fi; " \ + "fi; " \ + "done\0" \ + "" + +/* +* boottargets +* - set 'subbootcmds' for the bootrunner +* - set 'bootcmd' and 'altbootcmd' +* available targets: +* - 'release': for a standalone system kernel/rootfs from flash +* - 'develop': for development kernel(tftp)/rootfs(NFS) +* - 'ramfs': rootfilesystem in RAM kernel(tftp)/rootfs(RAM) +* +* - 'commonargs': bootargs common to all targets +*/ +#define CONFIG_KM_DEF_ENV_BOOTTARGETS \ + "commonargs=" \ + "addip " \ + "addtty " \ + "addmem " \ + "addinit " \ + "addvar " \ + "addmtdparts " \ + "addbootcount " \ + "\0" \ + "develop=" \ + "setenv subbootcmds \"" \ + "tftpfdt tftpkernel " \ + "nfsargs ${commonargs} " \ + "printbootargs boot " \ + "\" && " \ + "setenv bootcmd \'" \ + "run bootrunner" \ + "\' && " \ + "setenv altbootcmd \'" \ + "run bootcmd" \ + "\' && " \ + "run setboardid && " \ + "saveenv && " \ + "reset\0" \ + "ramfs=" \ + "setenv actual_bank -1 && " \ + "setenv subbootcmds \"" \ + "tftpfdt tftpkernel " \ + "setrootfsaddr tftpramfs " \ + "flashargs ${commonargs} " \ + "addpanic addramfs " \ + "printbootargs boot " \ + "\" && " \ + "setenv bootcmd \'" \ + "run bootrunner" \ + "\' && " \ + "setenv altbootcmd \'" \ + "run bootcmd" \ + "\' && " \ + "run setboardid && " \ + "run setramfspram && " \ + "saveenv && " \ + "reset\0" \ + "release=" \ + "setenv actual_bank ${initial_boot_bank} && " \ + "setenv subbootcmds \"" \ + "checkboardid " \ + "ubiattach ubicopy " \ + "cramfsloadfdt cramfsloadkernel " \ + "flashargs ${commonargs} " \ + "addpanic " \ + "printbootargs boot " \ + "\" && " \ + "setenv bootcmd \'" \ + "run bootrunner; reset" \ + "\' && " \ + "setenv altbootcmd \'" \ + "run actual0 bootcmd; reset" \ + "\' && " \ + "saveenv && " \ + "reset\0" \ + "" + +/* * bootargs * - modify 'bootargs' * * - 'addip': add ip configuration +* - 'addmem': limit kernel memory mem= * - 'addpanic': add kernel panic options * - 'addramfs': add phram device for the rootfilesysten in ram * - 'addtty': add console=... +* - 'addvar': add phram device for /var * - 'nfsargs': default arguments for nfs boot * - 'flashargs': defaults arguments for flash base boot * * processor specific settings +* - 'addbootcount': add boot counter * - 'addmtdparts': add mtd partition information */ #define CONFIG_KM_DEF_ENV_BOOTARGS \
@@ -204,6 +284,8 @@"setenv bootargs ${bootargs} " \"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \":${hostname}:${netdev}:off\0" \ +"addmem=" \ +"setenv bootargs ${bootargs} mem=0x${pnvramaddr}\0" \"addpanic=" \"setenv bootargs ${bootargs} " \"panic=1 panic_on_oops=1\0" \
@@ -214,6 +296,9 @@"addtty=" \"setenv bootargs ${bootargs}" \" console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}\0" \ +"addvar=" \ +"setenv bootargs ${bootargs} phram.phram=phvar," \ + "${varaddr},0x" xstr(CONFIG_KM_PHRAM) "\0" \"nfsargs=" \"setenv bootargs " \"ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " " \
@@ -226,6 +311,14 @@"rootfstype=squashfs ro\0" \"" +/* +* compute_addr +* - compute addresses and sizes +* - addresses are calculated form the end of memory 'memsize' +* +* - 'setramfspram': compute PRAM size for ramfs target +* - 'setrootfsaddr': compute rootfilesystem address for phram +*/ #define CONFIG_KM_DEF_ENV_COMPUTE_ADDR \"setboardid=" \"if test \"x${boardId}\" = \"x\"; then; " \
@@ -233,7 +326,15 @@"setenv hwKey ${IVM_HWKey}; " \"else; " \"echo \\\\c; " \ -"fi\0" +"fi\0" \ +"setramfspram=" \ +"setexpr value ${rootfssize} / 0x400 && " \ +"setexpr value 0x${value} + ${pram} && " \ +"setenv pram 0x${value}\0" \ +"setrootfsaddr=" \ +"setexpr value ${pnvramaddr} - ${rootfssize} && " \ +"setenv rootfsaddr 0x${value}\0" \ +"" /* * flash_boot
@@ -264,6 +365,7 @@* - commands for booting over the network * * - 'tftpkernel': load a kernel with tftp into ram +* - 'tftpramfs': load rootfs with tftp into ram * * processor specific settings * - 'tftpfdt': load fdt with tftp into ram
@@ -271,7 +373,11 @@#define CONFIG_KM_DEF_ENV_NET_BOOT \ "tftpkernel=" \ "tftpboot ${kernel_addr_r} ${kernel_file} && " \ - "setenv actual_kernel_addr ${kernel_addr_r} \0" + "setenv actual_kernel_addr ${kernel_addr_r}\0" \ + "tftpramfs=" \ + "tftpboot ${rootfsaddr} \"\\\"${rootfsfile}\\\"\" && " \ + "setenv loadaddr\0" \ + ""/* * constants
@@ -294,14 +400,17 @@#ifndef CONFIG_KM_DEF_ENV #define CONFIG_KM_DEF_ENV \ + CONFIG_KM_DEF_ENV_BOOTPARAMS \ CONFIG_KM_DEF_ENV_IOMUX \ - CONFIG_KM_DEF_ENV_PRIVATE \ CONFIG_KM_DEF_NETDEV \ CONFIG_KM_DEF_ENV_CPU \ + CONFIG_KM_DEF_ENV_BOOTRUNNER \ + CONFIG_KM_DEF_ENV_BOOTTARGETS \ CONFIG_KM_DEF_ENV_BOOTARGS \ CONFIG_KM_DEF_ENV_COMPUTE_ADDR \ CONFIG_KM_DEF_ENV_FLASH_BOOT \ CONFIG_KM_DEF_ENV_NET_BOOT \ + CONFIG_KM_DEF_ENV_CONSTANTS \ "altbootcmd=run bootcmd\0" \ "bootcmd=run default\0" \ "bootlimit=2\0" \
include/configs/km_arm.h +2 -0
@@ -260,5 +260,7 @@ int get_scl (void);* 8Mbytes for switch + 4Kbytes for bootcount */ #define CONFIG_KM_RESERVED_PRAM 0x801000 +/* address for the bootcount (taken from end of RAM) */ +#define BOOTCOUNT_ADDR (CONFIG_KM_RESERVED_PRAM)#endif /* _CONFIG_KM_ARM_H */
Signature · 1 line
1.7.4
PATCH v4 22/23 keymile boards: support of boardId / hwkey lists
In reply to Heiko SchocherFrom: Thomas Herzmann <[email protected]>
In order to support boardId / hwkey lists, the u-boot default environment has been updated: Added a script checkboardidlist which checks the list of boardId / hwkey if the boadrId / hwkey of the IVM is included in that list. This feature is used if you got different HW variants but you only want to create one boot package. E.g. supx5 board series.
---
Changes for v2:
- nothing
Changes for v3:
- rebased only
include/configs/keymile-common.h | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-)
include/configs/keymile-common.h +28 -1
@@ -243,6 +243,7 @@"release=" \"setenv actual_bank ${initial_boot_bank} && " \"setenv subbootcmds \"" \ +"checkboardidlist " \"checkboardid " \"ubiattach ubicopy " \"cramfsloadfdt cramfsloadkernel " \
@@ -392,8 +393,34 @@"default=" \"setenv default 'run newenv; reset' && " \"run release && saveenv; reset\0" \ +"checkboardidlist=" \ +"if test \"x${boardIdListHex}\" != \"x\"; then " \ +"IVMbidhwk=${IVM_BoardId}_${IVM_HWKey}; " \ +"found=0; " \ +"for bidhwk in \"${boardIdListHex}\"; do " \ +"echo trying $bidhwk ...; " \ +"if test \"x$bidhwk\" = \"x$IVMbidhwk\"; then " \ +"found=1; " \ +"echo match found for $bidhwk; " \ +"if test \"x$bidhwk\" != \"x${boardId}_${hwKey}\";then " \ +"setenv boardid ${IVM_BoardId}; " \ +"setenv boardId ${IVM_BoardId}; " \ +"setenv hwkey ${IVM_HWKey}; " \ +"setenv hwKey ${IVM_HWKey}; " \ +"echo \"boardId set to ${boardId}\"; " \ +"echo \"hwKey set to ${hwKey}\"; " \ +"saveenv; " \ +"fi; " \ +"fi; " \ +"done; " \ +"else " \ +"echo \"boardIdListHex not set, not checked\"; " \ +"found=1; " \ +"fi; " \ +"test \"$found\" = 1 \0" \"checkboardid=" \ -"test \"x${boardId}\" = \"x${IVM_BoardId}\"\0" \ +"test \"x${boardId}\" = \"x${IVM_BoardId}\" && " \ +"test \"x${hwKey}\" = \"x${IVM_HWKey}\"\0" \"printbootargs=print bootargs\0" \ "rootfsfile="xstr(CONFIG_HOSTNAME) "/rootfsImage\0" \""
Signature · 1 line
1.7.4
PATCH v4 23/23 keymile-common.h: remove IO mux stuff
In reply to Heiko SchocherFrom: Holger Brunck <[email protected]>
---
Changes for v2:
- fix checkpatch.pl errors and warnings
Changes for v3:
- rebased only
include/configs/keymile-common.h | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
include/configs/keymile-common.h +3 -6
@@ -137,11 +137,6 @@#define CONFIG_MTD_DEVICE #define CONFIG_MTD_CONCAT -#define CONFIG_KM_DEF_ENV_IOMUX \ - "stderr=serial \0" \ - "stdin=serial \0" \ - "stdout=serial \0" -/* common powerpc specific env settings */ #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
@@ -428,7 +423,6 @@#ifndef CONFIG_KM_DEF_ENV #define CONFIG_KM_DEF_ENV \ CONFIG_KM_DEF_ENV_BOOTPARAMS \ - CONFIG_KM_DEF_ENV_IOMUX \ CONFIG_KM_DEF_NETDEV \ CONFIG_KM_DEF_ENV_CPU \ CONFIG_KM_DEF_ENV_BOOTRUNNER \
@@ -448,6 +442,9 @@"load=tftpboot ${u-boot_addr_r} ${u-boot}\0" \"mtdids=" MTDIDS_DEFAULT "\0" \"mtdparts=" MTDPARTS_DEFAULT "\0" \ +"stderr=serial\0" \ +"stdin=serial\0" \ +"stdout=serial\0" \ "u-boot="xstr(CONFIG_HOSTNAME) "/u-boot.bin\0" \ "u-boot_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0" \""
Signature · 1 line
1.7.4
v4 cover keymile board update
In reply to Heiko SchocherDear Heiko Schocher,
Quoted 77 lines · In message <[email protected]> you wrote:
The following patchset updates the support for the keymile boards.
- fix a lot of Codingstyle issues for this boards
- heavy rework of the headerfiles, common board code
- add support for 4 new mpc83xx based boards
- add support for 1 82xx based board
- add support for 2 new kirkwood based boards
- fix i2c deblocking for this boardsHeiko Schocher (16):
powerpc, mpc83xx: add missing functions toinclude/common.h
keymile: Fix Coding style issues for keymile boards.
mpc832x: add support for the mpc8321 based suvd3 board
mpc832x: add support for mpc8321 based tuxa1 board
mpc832x: add support for mpc8321 based tuda1 board
arm: add support for kirkwood based mgcoge2un board
arm: add support of Kirkwood based board SUEN8
ppc: add support for ppc based board mgcoge2ne powerpc, 83xx: add kmsupx5 board support
km-arm: i2c support for suenx based boards
km_arm: change some register values for SDRAM initialization ppc, 8321: cleanup tuxa1, tuda1 and suvd3 support keymile, common; fix i2c deblocking support
arm, keymile: updates for the arm based boards from keymile keymile boards: addCONFIG_PIGGY_MAC_ADRESS_OFFSETkeymile, common: add setting of some environment variablesHolger Brunck (5):
arm, keymile: renameMACH_SUEN3toMACH_KM_KIRKWOODppc, arm: adapt keymile header
arm, ppc: rework environment variables for keymile boards ppc, arm: rework and enhancekeymile-common.hkeymile-common.h: remove IO mux stuffThomas Herzmann (1):
keymile boards: support of boardId / hwkey listsThomas Reufer (1):
keymile, 8321 boards: move common definitions tokm8321-common.hMAINTAINERS | 7 + arch/powerpc/cpu/mpc83xx/fdt.c | 3 +- arch/powerpc/lib/bootcount.c | 2 +- board/keymile/common/common.c | 496 ++++++++++++++++------------ board/keymile/common/common.h | 45 +++- board/keymile/{kmeter1 => km83xx}/Makefile | 0 board/keymile/km83xx/km83xx.c | 288 ++++++++++++++++ board/keymile/km_arm/km_arm.c | 91 ++++-- board/keymile/km_arm/kwbimage.cfg | 32 +- board/keymile/kmeter1/kmeter1.c | 217 ------------ board/keymile/mgcoge/mgcoge.c | 93 +++--- boards.cfg | 9 +- include/common.h | 5 + include/configs/keymile-common.h | 489 +++++++++++++++++++--------- include/configs/km-powerpc.h | 92 +++++ include/configs/km82xx-common.h | 336 +++++++++++++++++++ include/configs/km8321-common.h | 137 ++++++++ include/configs/km83xx-common.h | 325 ++++++++++++++++++ include/configs/km_arm.h | 104 +++++- include/configs/kmeter1.h | 368 ++------------------- include/configs/kmsupx5.h | 91 +++++ include/configs/mgcoge.h | 307 +----------------- include/configs/mgcoge2ne.h | 64 ++++ include/configs/mgcoge2un.h | 65 ++++ include/configs/suen3.h | 45 +--- include/configs/suen8.h | 65 ++++ include/configs/suvd3.h | 104 ++++++ include/configs/tuda1.h | 141 ++++++++ include/configs/tuxa1.h | 124 +++++++ 29 files changed, 2792 insertions(+), 1353 deletions(-) rename board/keymile/{kmeter1 => km83xx}/Makefile (100%) create mode 100644 board/keymile/km83xx/km83xx.c delete mode 100644 board/keymile/kmeter1/kmeter1.c create mode 100644 include/configs/km-powerpc.h create mode 100644 include/configs/km82xx-common.h create mode 100644 include/configs/km8321-common.h
Quoted 8 lines
create mode 100644 include/configs/km83xx-common.h create mode 100644 include/configs/kmsupx5.h create mode 100644 include/configs/mgcoge2ne.h create mode 100644 include/configs/mgcoge2un.h create mode 100644 include/configs/suen8.h create mode 100644 include/configs/suvd3.h create mode 100644 include/configs/tuda1.h create mode 100644 include/configs/tuxa1.h
All applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Cleverness and Style have no place in getting a project completed.
-- Tom Christiansen