Commit cf946c6d09938e1e6ef01a7488c6e75a1cf71c47

Authored by Lei Wen
Committed by Albert Aribaud
1 parent 495df3bad9

mv: seperate kirkwood and armada from common setting

Since there are lots of difference between kirkwood and armada series,
it is better to seperate them but still keep the most common file
shared by all marvell platform in the mv-common configure file.

This patch move the kirkwood only driver definitoin in mv-common to
the <soc_name>/config.h.

This patch is tested with compilation for armada100 and guruplug.

Signed-off-by: Lei Wen <leiwen@marvell.com>

Showing 5 changed files with 223 additions and 126 deletions Side-by-side Diff

... ... @@ -319,6 +319,11 @@
319 319 CONFIG_SYS_PQ2FADS - PQ2FADS-ZU or PQ2FADS-VR
320 320 CONFIG_SYS_8272ADS - MPC8272ADS
321 321  
  322 +- Marvell Family Member
  323 + CONFIG_SYS_MVFS - define it if you want to enable
  324 + multiple fs option at one time
  325 + for marvell soc family
  326 +
322 327 - MPC824X Family Member (if CONFIG_MPC824X is defined)
323 328 Define exactly one of
324 329 CONFIG_MPC8240, CONFIG_MPC8245
arch/arm/include/asm/arch-armada100/config.h
  1 +/*
  2 + * (C) Copyright 2011
  3 + * Marvell Semiconductor <www.marvell.com>
  4 + * Written-by: Lei Wen <leiwen@marvell.com>
  5 + *
  6 + * See file CREDITS for list of people who contributed to this
  7 + * project.
  8 + *
  9 + * This program is free software; you can redistribute it and/or
  10 + * modify it under the terms of the GNU General Public License as
  11 + * published by the Free Software Foundation; either version 2 of
  12 + * the License, or (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  22 + * MA 02110-1301 USA
  23 + */
  24 +
  25 +/*
  26 + * This file should be included in board config header file.
  27 + *
  28 + * It supports common definitions for Armada100 platform
  29 + */
  30 +
  31 +#ifndef _ARMD1_CONFIG_H
  32 +#define _ARMD1_CONFIG_H
  33 +
  34 +#define CONFIG_ARM926EJS 1 /* Basic Architecture */
  35 +
  36 +#define CONFIG_SYS_TCLK (14745600) /* NS16550 clk config */
  37 +#define CONFIG_SYS_HZ_CLOCK (3250000) /* Timer Freq. 3.25MHZ */
  38 +#define CONFIG_MARVELL_MFP /* Enable mvmfp driver */
  39 +#define MV_MFPR_BASE ARMD1_MFPR_BASE
  40 +#define MV_UART_CONSOLE_BASE ARMD1_UART1_BASE
  41 +#define CONFIG_SYS_NS16550_IER (1 << 6) /* Bit 6 in UART_IER register
  42 + represents UART Unit Enable */
  43 +
  44 +#endif /* _ARMD1_CONFIG_H */
arch/arm/include/asm/arch-kirkwood/config.h
  1 +/*
  2 + * (C) Copyright 2011
  3 + * Marvell Semiconductor <www.marvell.com>
  4 + * Written-by: Lei Wen <leiwen@marvell.com>
  5 + *
  6 + * See file CREDITS for list of people who contributed to this
  7 + * project.
  8 + *
  9 + * This program is free software; you can redistribute it and/or
  10 + * modify it under the terms of the GNU General Public License as
  11 + * published by the Free Software Foundation; either version 2 of
  12 + * the License, or (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  22 + * MA 02110-1301 USA
  23 + */
  24 +
  25 +/*
  26 + * This file should be included in board config header file.
  27 + *
  28 + * It supports common definitions for Kirkwood platform
  29 + */
  30 +
  31 +#ifndef _KW_CONFIG_H
  32 +#define _KW_CONFIG_H
  33 +
  34 +#if defined (CONFIG_KW88F6281)
  35 +#include <asm/arch/kw88f6281.h>
  36 +#elif defined (CONFIG_KW88F6192)
  37 +#include <asm/arch/kw88f6192.h>
  38 +#else
  39 +#error "SOC Name not defined"
  40 +#endif /* CONFIG_KW88F6281 */
  41 +
  42 +#define CONFIG_ARM926EJS 1 /* Basic Architecture */
  43 +
  44 +#define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */
  45 +#define CONFIG_KIRKWOOD_EGIGA_INIT /* Enable GbePort0/1 for kernel */
  46 +#define CONFIG_KIRKWOOD_RGMII_PAD_1V8 /* Set RGMII Pad voltage to 1.8V */
  47 +#define CONFIG_KIRKWOOD_PCIE_INIT /* Enable PCIE Port0 for kernel */
  48 +
  49 +/*
  50 + * By default kwbimage.cfg from board specific folder is used
  51 + * If for some board, different configuration file need to be used,
  52 + * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
  53 + */
  54 +#ifndef CONFIG_SYS_KWD_CONFIG
  55 +#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
  56 +#endif /* CONFIG_SYS_KWD_CONFIG */
  57 +
  58 +/* Kirkwood has 2k of Security SRAM, use it for SP */
  59 +#define CONFIG_SYS_INIT_SP_ADDR 0xC8012000
  60 +#define CONFIG_NR_DRAM_BANKS_MAX 2
  61 +
  62 +#define CONFIG_I2C_MVTWSI_BASE KW_TWSI_BASE
  63 +#define MV_UART_CONSOLE_BASE KW_UART0_BASE
  64 +#define MV_SATA_BASE KW_SATA_BASE
  65 +#define MV_SATA_PORT0_OFFSET KW_SATA_PORT0_OFFSET
  66 +#define MV_SATA_PORT1_OFFSET KW_SATA_PORT1_OFFSET
  67 +
  68 +/*
  69 + * NAND configuration
  70 + */
  71 +#ifdef CONFIG_CMD_NAND
  72 +#define CONFIG_NAND_KIRKWOOD
  73 +#define CONFIG_SYS_NAND_BASE 0xD8000000 /* MV_DEFADR_NANDF */
  74 +#define NAND_ALLOW_ERASE_ALL 1
  75 +#endif
  76 +
  77 +/*
  78 + * SPI Flash configuration
  79 + */
  80 +#ifdef CONFIG_CMD_SF
  81 +#define CONFIG_HARD_SPI 1
  82 +#define CONFIG_KIRKWOOD_SPI 1
  83 +#define CONFIG_ENV_SPI_BUS 0
  84 +#define CONFIG_ENV_SPI_CS 0
  85 +#define CONFIG_ENV_SPI_MAX_HZ 50000000 /*50Mhz */
  86 +#endif
  87 +
  88 +/*
  89 + * Ethernet Driver configuration
  90 + */
  91 +#ifdef CONFIG_CMD_NET
  92 +#define CONFIG_CMD_MII
  93 +#define CONFIG_NETCONSOLE /* include NetConsole support */
  94 +#define CONFIG_NET_MULTI /* specify more that one ports available */
  95 +#define CONFIG_MII /* expose smi ove miiphy interface */
  96 +#define CONFIG_MVGBE /* Enable Marvell Gbe Controller Driver */
  97 +#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link using phy */
  98 +#define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */
  99 +#define CONFIG_RESET_PHY_R /* use reset_phy() to init mv8831116 PHY */
  100 +#endif /* CONFIG_CMD_NET */
  101 +
  102 +/*
  103 + * USB/EHCI
  104 + */
  105 +#ifdef CONFIG_CMD_USB
  106 +#define CONFIG_USB_EHCI_KIRKWOOD
  107 +#define CONFIG_EHCI_IS_TDI
  108 +#endif /* CONFIG_CMD_USB */
  109 +
  110 +/*
  111 + * IDE Support on SATA ports
  112 + */
  113 +#ifdef CONFIG_CMD_IDE
  114 +#define __io
  115 +#define CONFIG_CMD_EXT2
  116 +#define CONFIG_MVSATA_IDE
  117 +#define CONFIG_IDE_PREINIT
  118 +#define CONFIG_MVSATA_IDE_USE_PORT1
  119 +/* Needs byte-swapping for ATA data register */
  120 +#define CONFIG_IDE_SWAP_IO
  121 +/* Data, registers and alternate blocks are at the same offset */
  122 +#define CONFIG_SYS_ATA_DATA_OFFSET (0x0100)
  123 +#define CONFIG_SYS_ATA_REG_OFFSET (0x0100)
  124 +#define CONFIG_SYS_ATA_ALT_OFFSET (0x0100)
  125 +/* Each 8-bit ATA register is aligned to a 4-bytes address */
  126 +#define CONFIG_SYS_ATA_STRIDE 4
  127 +/* Controller supports 48-bits LBA addressing */
  128 +#define CONFIG_LBA48
  129 +/* CONFIG_CMD_IDE requires some #defines for ATA registers */
  130 +#define CONFIG_SYS_IDE_MAXBUS 2
  131 +#define CONFIG_SYS_IDE_MAXDEVICE 2
  132 +/* ATA registers base is at SATA controller base */
  133 +#define CONFIG_SYS_ATA_BASE_ADDR MV_SATA_BASE
  134 +#endif /* CONFIG_CMD_IDE */
  135 +
  136 +/*
  137 + * I2C related stuff
  138 + */
  139 +#ifdef CONFIG_CMD_I2C
  140 +#define CONFIG_I2C_MVTWSI
  141 +#define CONFIG_SYS_I2C_SLAVE 0x0
  142 +#define CONFIG_SYS_I2C_SPEED 100000
  143 +#endif
  144 +
  145 +#endif /* _KW_CONFIG_H */
include/configs/aspenite.h
... ... @@ -41,6 +41,13 @@
41 41 #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
42 42  
43 43 /*
  44 + * There is no internal RAM in ARMADA100, using DRAM
  45 + * TBD: dcache to be used for this
  46 + */
  47 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE - 0x00200000)
  48 +#define CONFIG_NR_DRAM_BANKS_MAX 2
  49 +
  50 +/*
44 51 * Commands configuration
45 52 */
46 53 #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
... ... @@ -53,6 +60,7 @@
53 60 * to enable certain macros
54 61 */
55 62 #include "mv-common.h"
  63 +#undef CONFIG_ARCH_MISC_INIT
56 64  
57 65 /*
58 66 * Environment variables configurations
include/configs/mv-common.h
... ... @@ -37,56 +37,8 @@
37 37 * High Level Configuration Options (easy to change)
38 38 */
39 39 #define CONFIG_MARVELL 1
40   -#define CONFIG_ARM926EJS 1 /* Basic Architecture */
41 40  
42   -/* ====> Kirkwood Platform Common Definations */
43   -#if defined(CONFIG_KIRKWOOD)
44   -#define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */
45   -#define CONFIG_KIRKWOOD_EGIGA_INIT /* Enable GbePort0/1 for kernel */
46   -#define CONFIG_KIRKWOOD_RGMII_PAD_1V8 /* Set RGMII Pad voltage to 1.8V */
47   -#define CONFIG_KIRKWOOD_PCIE_INIT /* Enable PCIE Port0 for kernel */
48   -
49 41 /*
50   - * By default kwbimage.cfg from board specific folder is used
51   - * If for some board, different configuration file need to be used,
52   - * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
53   - */
54   -#ifndef CONFIG_SYS_KWD_CONFIG
55   -#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
56   -#endif /* CONFIG_SYS_KWD_CONFIG */
57   -
58   -/* Kirkwood has 2k of Security SRAM, use it for SP */
59   -#define CONFIG_SYS_INIT_SP_ADDR 0xC8012000
60   -#define CONFIG_NR_DRAM_BANKS_MAX 2
61   -
62   -#define CONFIG_I2C_MVTWSI_BASE KW_TWSI_BASE
63   -#define MV_UART_CONSOLE_BASE KW_UART0_BASE
64   -#define MV_SATA_BASE KW_SATA_BASE
65   -#define MV_SATA_PORT0_OFFSET KW_SATA_PORT0_OFFSET
66   -#define MV_SATA_PORT1_OFFSET KW_SATA_PORT1_OFFSET
67   -
68   -/* ====> ARMADA100 Platform Common Definations */
69   -#elif defined (CONFIG_ARMADA100)
70   -
71   -#define CONFIG_SYS_TCLK (14745600) /* NS16550 clk config */
72   -#define CONFIG_SYS_HZ_CLOCK (3250000) /* Timer Freq. 3.25MHZ */
73   -#define CONFIG_MARVELL_MFP /* Enable mvmfp driver */
74   -#define MV_MFPR_BASE ARMD1_MFPR_BASE
75   -#define MV_UART_CONSOLE_BASE ARMD1_UART1_BASE
76   -#define CONFIG_SYS_NS16550_IER (1 << 6) /* Bit 6 in UART_IER register
77   - represents UART Unit Enable */
78   -/*
79   - * There is no internal RAM in ARMADA100, using DRAM
80   - * TBD: dcache to be used for this
81   - */
82   -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE - 0x00200000)
83   -#define CONFIG_NR_DRAM_BANKS_MAX 2
84   -
85   -#else
86   -#error "Unsupported SoC Platform..."
87   -#endif
88   -
89   -/*
90 42 * Custom CONFIG_SYS_TEXT_BASE can be done in <board>.h
91 43 */
92 44 #ifndef CONFIG_SYS_TEXT_BASE
... ... @@ -138,31 +90,6 @@
138 90 +sizeof(CONFIG_SYS_PROMPT) + 16) /* Print Buff */
139 91  
140 92 /*
141   - * NAND configuration
142   - */
143   -#ifdef CONFIG_CMD_NAND
144   -#define CONFIG_NAND_KIRKWOOD
145   -#define CONFIG_SYS_MAX_NAND_DEVICE 1
146   -#define NAND_MAX_CHIPS 1
147   -#define CONFIG_SYS_NAND_BASE 0xD8000000 /* MV_DEFADR_NANDF */
148   -#define NAND_ALLOW_ERASE_ALL 1
149   -#define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */
150   -#endif
151   -
152   -/*
153   - * SPI Flash configuration
154   - */
155   -#ifdef CONFIG_CMD_SF
156   -#define CONFIG_SPI_FLASH 1
157   -#define CONFIG_HARD_SPI 1
158   -#define CONFIG_KIRKWOOD_SPI 1
159   -#define CONFIG_SPI_FLASH_MACRONIX 1
160   -#define CONFIG_ENV_SPI_BUS 0
161   -#define CONFIG_ENV_SPI_CS 0
162   -#define CONFIG_ENV_SPI_MAX_HZ 50000000 /*50Mhz */
163   -#endif
164   -
165   -/*
166 93 * Size of malloc() pool
167 94 */
168 95 #define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* 1MiB for malloc() */
169 96  
... ... @@ -176,9 +103,7 @@
176 103 #define CONFIG_CMDLINE_EDITING
177 104 #define CONFIG_CONSOLE_INFO_QUIET /* some code reduction */
178 105 #define CONFIG_ARCH_CPU_INIT /* call arch_cpu_init() */
179   -#ifndef CONFIG_ARMADA100 /* will be removed latter */
180 106 #define CONFIG_ARCH_MISC_INIT /* call arch_misc_init() */
181   -#endif /* CONFIG_ARMADA100 */
182 107 #define CONFIG_BOARD_EARLY_INIT_F /* call board_init_f for early inits */
183 108 #define CONFIG_DISPLAY_CPUINFO /* Display cpu info */
184 109 #define CONFIG_STACKSIZE 0x00100000 /* regular stack- 1M */
185 110  
186 111  
187 112  
188 113  
189 114  
... ... @@ -199,27 +124,32 @@
199 124 #endif
200 125 #endif /* CONFIG_NR_DRAM_BANKS */
201 126  
  127 +/* ====> Include platform Common Definations */
  128 +#include <asm/arch/config.h>
  129 +
  130 +/* ====> Include driver Common Definations */
202 131 /*
203   - * Ethernet Driver configuration
  132 + * Common NAND configuration
204 133 */
205   -#ifdef CONFIG_CMD_NET
206   -#define CONFIG_CMD_MII
207   -#define CONFIG_NETCONSOLE /* include NetConsole support */
208   -#define CONFIG_NET_MULTI /* specify more that one ports available */
209   -#define CONFIG_MII /* expose smi ove miiphy interface */
210   -#define CONFIG_MVGBE /* Enable Marvell Gbe Controller Driver */
211   -#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link using phy */
212   -#define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */
213   -#define CONFIG_RESET_PHY_R /* use reset_phy() to init mv8831116 PHY */
214   -#endif /* CONFIG_CMD_NET */
  134 +#ifdef CONFIG_CMD_NAND
  135 +#define CONFIG_SYS_MAX_NAND_DEVICE 1
  136 +#define NAND_MAX_CHIPS 1
  137 +#define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */
  138 +#endif
215 139  
216 140 /*
217   - * USB/EHCI
  141 + * Common SPI Flash configuration
218 142 */
  143 +#ifdef CONFIG_CMD_SF
  144 +#define CONFIG_SPI_FLASH 1
  145 +#define CONFIG_SPI_FLASH_MACRONIX 1
  146 +#endif
  147 +
  148 +/*
  149 + * Common USB/EHCI configuration
  150 + */
219 151 #ifdef CONFIG_CMD_USB
220 152 #define CONFIG_USB_EHCI /* Enable EHCI USB support */
221   -#define CONFIG_USB_EHCI_KIRKWOOD
222   -#define CONFIG_EHCI_IS_TDI
223 153 #define CONFIG_USB_STORAGE
224 154 #define CONFIG_DOS_PARTITION
225 155 #define CONFIG_ISO_PARTITION
226 156  
... ... @@ -227,44 +157,9 @@
227 157 #endif /* CONFIG_CMD_USB */
228 158  
229 159 /*
230   - * IDE Support on SATA ports
231   - */
232   -#ifdef CONFIG_CMD_IDE
233   -#define __io
234   -#define CONFIG_CMD_EXT2
235   -#define CONFIG_MVSATA_IDE
236   -#define CONFIG_IDE_PREINIT
237   -#define CONFIG_MVSATA_IDE_USE_PORT1
238   -/* Needs byte-swapping for ATA data register */
239   -#define CONFIG_IDE_SWAP_IO
240   -/* Data, registers and alternate blocks are at the same offset */
241   -#define CONFIG_SYS_ATA_DATA_OFFSET (0x0100)
242   -#define CONFIG_SYS_ATA_REG_OFFSET (0x0100)
243   -#define CONFIG_SYS_ATA_ALT_OFFSET (0x0100)
244   -/* Each 8-bit ATA register is aligned to a 4-bytes address */
245   -#define CONFIG_SYS_ATA_STRIDE 4
246   -/* Controller supports 48-bits LBA addressing */
247   -#define CONFIG_LBA48
248   -/* CONFIG_CMD_IDE requires some #defines for ATA registers */
249   -#define CONFIG_SYS_IDE_MAXBUS 2
250   -#define CONFIG_SYS_IDE_MAXDEVICE 2
251   -/* ATA registers base is at SATA controller base */
252   -#define CONFIG_SYS_ATA_BASE_ADDR MV_SATA_BASE
253   -#endif /* CONFIG_CMD_IDE */
254   -
255   -/*
256   - * I2C related stuff
257   - */
258   -#ifdef CONFIG_CMD_I2C
259   -#define CONFIG_I2C_MVTWSI
260   -#define CONFIG_SYS_I2C_SLAVE 0x0
261   -#define CONFIG_SYS_I2C_SPEED 100000
262   -#endif
263   -
264   -/*
265 160 * File system
266 161 */
267   -#ifndef CONFIG_ARMADA100 /* will be removed latter */
  162 +#ifdef CONFIG_SYS_MVFS
268 163 #define CONFIG_CMD_EXT2
269 164 #define CONFIG_CMD_JFFS2
270 165 #define CONFIG_CMD_FAT
... ... @@ -275,7 +170,7 @@
275 170 #define CONFIG_MTD_PARTITIONS
276 171 #define CONFIG_CMD_MTDPARTS
277 172 #define CONFIG_LZO
278   -#endif /* CONFIG_ARMADA100 */
  173 +#endif
279 174  
280 175 #endif /* _MV_COMMON_H */