Lei Wen | cf946c6 | 2011-02-09 18:06:58 +0530 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2011 |
| 3 | * Marvell Semiconductor <www.marvell.com> |
| 4 | * Written-by: Lei Wen <leiwen@marvell.com> |
| 5 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Lei Wen | cf946c6 | 2011-02-09 18:06:58 +0530 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | /* |
| 10 | * This file should be included in board config header file. |
| 11 | * |
| 12 | * It supports common definitions for Kirkwood platform |
| 13 | */ |
| 14 | |
| 15 | #ifndef _KW_CONFIG_H |
| 16 | #define _KW_CONFIG_H |
| 17 | |
| 18 | #if defined (CONFIG_KW88F6281) |
| 19 | #include <asm/arch/kw88f6281.h> |
| 20 | #elif defined (CONFIG_KW88F6192) |
| 21 | #include <asm/arch/kw88f6192.h> |
| 22 | #else |
| 23 | #error "SOC Name not defined" |
| 24 | #endif /* CONFIG_KW88F6281 */ |
| 25 | |
Lei Wen | a7efd71 | 2011-10-18 20:11:42 +0530 | [diff] [blame] | 26 | #include <asm/arch/kirkwood.h> |
Lei Wen | cf946c6 | 2011-02-09 18:06:58 +0530 | [diff] [blame] | 27 | #define CONFIG_ARM926EJS 1 /* Basic Architecture */ |
Michael Walle | f779d73 | 2011-10-31 20:22:58 +0530 | [diff] [blame] | 28 | #define CONFIG_SYS_CACHELINE_SIZE 32 |
| 29 | /* default Dcache Line length for kirkwood */ |
Lei Wen | cf946c6 | 2011-02-09 18:06:58 +0530 | [diff] [blame] | 30 | #define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */ |
| 31 | #define CONFIG_KIRKWOOD_EGIGA_INIT /* Enable GbePort0/1 for kernel */ |
| 32 | #define CONFIG_KIRKWOOD_RGMII_PAD_1V8 /* Set RGMII Pad voltage to 1.8V */ |
| 33 | #define CONFIG_KIRKWOOD_PCIE_INIT /* Enable PCIE Port0 for kernel */ |
| 34 | |
| 35 | /* |
| 36 | * By default kwbimage.cfg from board specific folder is used |
| 37 | * If for some board, different configuration file need to be used, |
| 38 | * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file |
| 39 | */ |
| 40 | #ifndef CONFIG_SYS_KWD_CONFIG |
Masahiro Yamada | 4ab3fc5 | 2014-03-11 11:05:17 +0900 | [diff] [blame] | 41 | #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage.cfg |
Lei Wen | cf946c6 | 2011-02-09 18:06:58 +0530 | [diff] [blame] | 42 | #endif /* CONFIG_SYS_KWD_CONFIG */ |
| 43 | |
| 44 | /* Kirkwood has 2k of Security SRAM, use it for SP */ |
| 45 | #define CONFIG_SYS_INIT_SP_ADDR 0xC8012000 |
| 46 | #define CONFIG_NR_DRAM_BANKS_MAX 2 |
| 47 | |
| 48 | #define CONFIG_I2C_MVTWSI_BASE KW_TWSI_BASE |
| 49 | #define MV_UART_CONSOLE_BASE KW_UART0_BASE |
| 50 | #define MV_SATA_BASE KW_SATA_BASE |
| 51 | #define MV_SATA_PORT0_OFFSET KW_SATA_PORT0_OFFSET |
| 52 | #define MV_SATA_PORT1_OFFSET KW_SATA_PORT1_OFFSET |
| 53 | |
| 54 | /* |
| 55 | * NAND configuration |
| 56 | */ |
| 57 | #ifdef CONFIG_CMD_NAND |
| 58 | #define CONFIG_NAND_KIRKWOOD |
| 59 | #define CONFIG_SYS_NAND_BASE 0xD8000000 /* MV_DEFADR_NANDF */ |
| 60 | #define NAND_ALLOW_ERASE_ALL 1 |
| 61 | #endif |
| 62 | |
| 63 | /* |
| 64 | * SPI Flash configuration |
| 65 | */ |
| 66 | #ifdef CONFIG_CMD_SF |
| 67 | #define CONFIG_HARD_SPI 1 |
| 68 | #define CONFIG_KIRKWOOD_SPI 1 |
Valentin Longchamp | dacc8c6 | 2012-06-13 03:03:52 +0000 | [diff] [blame] | 69 | #ifndef CONFIG_ENV_SPI_BUS |
| 70 | # define CONFIG_ENV_SPI_BUS 0 |
| 71 | #endif |
| 72 | #ifndef CONFIG_ENV_SPI_CS |
| 73 | # define CONFIG_ENV_SPI_CS 0 |
| 74 | #endif |
| 75 | #ifndef CONFIG_ENV_SPI_MAX_HZ |
| 76 | # define CONFIG_ENV_SPI_MAX_HZ 50000000 |
| 77 | #endif |
Lei Wen | cf946c6 | 2011-02-09 18:06:58 +0530 | [diff] [blame] | 78 | #endif |
| 79 | |
| 80 | /* |
| 81 | * Ethernet Driver configuration |
| 82 | */ |
| 83 | #ifdef CONFIG_CMD_NET |
| 84 | #define CONFIG_CMD_MII |
| 85 | #define CONFIG_NETCONSOLE /* include NetConsole support */ |
Lei Wen | cf946c6 | 2011-02-09 18:06:58 +0530 | [diff] [blame] | 86 | #define CONFIG_MII /* expose smi ove miiphy interface */ |
| 87 | #define CONFIG_MVGBE /* Enable Marvell Gbe Controller Driver */ |
| 88 | #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link using phy */ |
| 89 | #define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */ |
| 90 | #define CONFIG_RESET_PHY_R /* use reset_phy() to init mv8831116 PHY */ |
| 91 | #endif /* CONFIG_CMD_NET */ |
| 92 | |
| 93 | /* |
| 94 | * USB/EHCI |
| 95 | */ |
| 96 | #ifdef CONFIG_CMD_USB |
Albert ARIBAUD | a14bd41 | 2012-02-06 20:39:29 +0530 | [diff] [blame] | 97 | #define CONFIG_USB_EHCI_MARVELL |
Lei Wen | cf946c6 | 2011-02-09 18:06:58 +0530 | [diff] [blame] | 98 | #define CONFIG_EHCI_IS_TDI |
| 99 | #endif /* CONFIG_CMD_USB */ |
| 100 | |
| 101 | /* |
| 102 | * IDE Support on SATA ports |
| 103 | */ |
| 104 | #ifdef CONFIG_CMD_IDE |
| 105 | #define __io |
| 106 | #define CONFIG_CMD_EXT2 |
| 107 | #define CONFIG_MVSATA_IDE |
| 108 | #define CONFIG_IDE_PREINIT |
| 109 | #define CONFIG_MVSATA_IDE_USE_PORT1 |
| 110 | /* Needs byte-swapping for ATA data register */ |
| 111 | #define CONFIG_IDE_SWAP_IO |
| 112 | /* Data, registers and alternate blocks are at the same offset */ |
| 113 | #define CONFIG_SYS_ATA_DATA_OFFSET (0x0100) |
| 114 | #define CONFIG_SYS_ATA_REG_OFFSET (0x0100) |
| 115 | #define CONFIG_SYS_ATA_ALT_OFFSET (0x0100) |
| 116 | /* Each 8-bit ATA register is aligned to a 4-bytes address */ |
| 117 | #define CONFIG_SYS_ATA_STRIDE 4 |
| 118 | /* Controller supports 48-bits LBA addressing */ |
| 119 | #define CONFIG_LBA48 |
| 120 | /* CONFIG_CMD_IDE requires some #defines for ATA registers */ |
| 121 | #define CONFIG_SYS_IDE_MAXBUS 2 |
| 122 | #define CONFIG_SYS_IDE_MAXDEVICE 2 |
| 123 | /* ATA registers base is at SATA controller base */ |
| 124 | #define CONFIG_SYS_ATA_BASE_ADDR MV_SATA_BASE |
| 125 | #endif /* CONFIG_CMD_IDE */ |
| 126 | |
| 127 | /* |
| 128 | * I2C related stuff |
| 129 | */ |
| 130 | #ifdef CONFIG_CMD_I2C |
Heiko Schocher | ea818db | 2013-01-29 08:53:15 +0100 | [diff] [blame] | 131 | #ifndef CONFIG_SYS_I2C_SOFT |
Hans de Goede | 0db2bbd | 2014-06-13 22:55:48 +0200 | [diff] [blame^] | 132 | #define CONFIG_SYS_I2C |
| 133 | #define CONFIG_SYS_I2C_MVTWSI |
Holger Brunck | b31a82e | 2011-06-16 18:11:15 +0530 | [diff] [blame] | 134 | #endif |
Lei Wen | cf946c6 | 2011-02-09 18:06:58 +0530 | [diff] [blame] | 135 | #define CONFIG_SYS_I2C_SLAVE 0x0 |
| 136 | #define CONFIG_SYS_I2C_SPEED 100000 |
| 137 | #endif |
| 138 | |
| 139 | #endif /* _KW_CONFIG_H */ |