Heiko Schocher | 67fa8c2 | 2010-02-22 16:43:02 +0530 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2009 |
| 3 | * Marvell Semiconductor <www.marvell.com> |
| 4 | * Prafulla Wadaskar <prafulla@marvell.com> |
| 5 | * |
| 6 | * (C) Copyright 2009 |
| 7 | * Stefan Roese, DENX Software Engineering, sr@denx.de. |
| 8 | * |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 9 | * (C) Copyright 2011-2012 |
| 10 | * Holger Brunck, Keymile GmbH Hannover, holger.brunck@keymile.com |
| 11 | * Valentin Longchamp, Keymile AG, valentin.longchamp@keymile.com |
Holger Brunck | 83b40c3 | 2011-06-16 18:11:15 +0530 | [diff] [blame] | 12 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 13 | * SPDX-License-Identifier: GPL-2.0+ |
Heiko Schocher | 67fa8c2 | 2010-02-22 16:43:02 +0530 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | /* |
| 17 | * for linking errors see |
| 18 | * http://lists.denx.de/pipermail/u-boot/2009-July/057350.html |
| 19 | */ |
| 20 | |
Holger Brunck | 83b40c3 | 2011-06-16 18:11:15 +0530 | [diff] [blame] | 21 | #ifndef _CONFIG_KM_KIRKWOOD_H |
| 22 | #define _CONFIG_KM_KIRKWOOD_H |
Heiko Schocher | 67fa8c2 | 2010-02-22 16:43:02 +0530 | [diff] [blame] | 23 | |
Holger Brunck | 48ced62 | 2012-07-05 05:05:06 +0000 | [diff] [blame] | 24 | /* KM_KIRKWOOD */ |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 25 | #if defined(CONFIG_KM_KIRKWOOD) |
| 26 | #define CONFIG_IDENT_STRING "\nKeymile Kirkwood" |
Holger Brunck | d935453 | 2012-07-05 05:05:02 +0000 | [diff] [blame] | 27 | #define CONFIG_HOSTNAME km_kirkwood |
Holger Brunck | 48ced62 | 2012-07-05 05:05:06 +0000 | [diff] [blame] | 28 | #define CONFIG_KM_DISABLE_PCIE |
Heiko Schocher | f3e9361 | 2012-10-25 11:07:00 +0200 | [diff] [blame] | 29 | #define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/ |
Holger Brunck | 48ced62 | 2012-07-05 05:05:06 +0000 | [diff] [blame] | 30 | |
| 31 | /* KM_KIRKWOOD_PCI */ |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 32 | #elif defined(CONFIG_KM_KIRKWOOD_PCI) |
| 33 | #define CONFIG_IDENT_STRING "\nKeymile Kirkwood PCI" |
Holger Brunck | d935453 | 2012-07-05 05:05:02 +0000 | [diff] [blame] | 34 | #define CONFIG_HOSTNAME km_kirkwood_pci |
Heiko Schocher | f3e9361 | 2012-10-25 11:07:00 +0200 | [diff] [blame] | 35 | #define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/ |
Holger Brunck | 48ced62 | 2012-07-05 05:05:06 +0000 | [diff] [blame] | 36 | #define CONFIG_KM_FPGA_CONFIG |
| 37 | |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 38 | /* KM_NUSA */ |
| 39 | #elif defined(CONFIG_KM_NUSA) |
Heiko Schocher | f3e9361 | 2012-10-25 11:07:00 +0200 | [diff] [blame] | 40 | #define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/ |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 41 | #define CONFIG_IDENT_STRING "\nKeymile NUSA" |
Holger Brunck | d935453 | 2012-07-05 05:05:02 +0000 | [diff] [blame] | 42 | #define CONFIG_HOSTNAME kmnusa |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 43 | #undef CONFIG_SYS_KWD_CONFIG |
| 44 | #define CONFIG_SYS_KWD_CONFIG \ |
| 45 | $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage_128M16_1.cfg |
| 46 | #define CONFIG_KM_ENV_IS_IN_SPI_NOR |
| 47 | #define CONFIG_KM_FPGA_CONFIG |
| 48 | #define CONFIG_KM_PIGGY4_88E6352 |
Valentin Longchamp | be3e8be | 2012-08-16 01:25:20 +0000 | [diff] [blame] | 49 | #define CONFIG_MV88E6352_SWITCH |
| 50 | #define CONFIG_KM_MVEXTSW_ADDR 0x10 |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 51 | |
Holger Brunck | f945439 | 2012-07-05 05:05:03 +0000 | [diff] [blame] | 52 | /* KM_MGCOGE3UN */ |
| 53 | #elif defined(CONFIG_KM_MGCOGE3UN) |
| 54 | #define CONFIG_IDENT_STRING "\nKeymile COGE3UN" |
| 55 | #define CONFIG_HOSTNAME mgcoge3un |
Heiko Schocher | f3e9361 | 2012-10-25 11:07:00 +0200 | [diff] [blame] | 56 | #define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/ |
Holger Brunck | f945439 | 2012-07-05 05:05:03 +0000 | [diff] [blame] | 57 | #undef CONFIG_SYS_KWD_CONFIG |
| 58 | #define CONFIG_SYS_KWD_CONFIG \ |
| 59 | $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-memphis.cfg |
| 60 | #define CONFIG_KM_BOARD_EXTRA_ENV "waitforne=true\0" |
| 61 | #define CONFIG_PIGGY_MAC_ADRESS_OFFSET 3 |
| 62 | #define CONFIG_KM_DISABLE_PCIE |
| 63 | #define CONFIG_KM_PIGGY4_88E6061 |
| 64 | |
| 65 | /* KMCOGE5UN */ |
Holger Brunck | d935453 | 2012-07-05 05:05:02 +0000 | [diff] [blame] | 66 | #elif defined(CONFIG_KM_COGE5UN) |
| 67 | #define CONFIG_IDENT_STRING "\nKeymile COGE5UN" |
Heiko Schocher | f3e9361 | 2012-10-25 11:07:00 +0200 | [diff] [blame] | 68 | #define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/ |
Holger Brunck | d935453 | 2012-07-05 05:05:02 +0000 | [diff] [blame] | 69 | #undef CONFIG_SYS_KWD_CONFIG |
| 70 | #define CONFIG_SYS_KWD_CONFIG \ |
| 71 | $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage_256M8_1.cfg |
| 72 | #define CONFIG_KM_ENV_IS_IN_SPI_NOR |
| 73 | #define CONFIG_PIGGY_MAC_ADRESS_OFFSET 3 |
| 74 | #define CONFIG_HOSTNAME kmcoge5un |
| 75 | #define CONFIG_KM_DISABLE_PCIE |
| 76 | #define CONFIG_KM_PIGGY4_88E6352 |
Holger Brunck | 6ef6486 | 2012-07-05 05:05:04 +0000 | [diff] [blame] | 77 | |
| 78 | /* KM_PORTL2 */ |
| 79 | #elif defined(CONFIG_KM_PORTL2) |
| 80 | #define CONFIG_IDENT_STRING "\nKeymile Port-L2" |
| 81 | #define CONFIG_HOSTNAME portl2 |
Heiko Schocher | f3e9361 | 2012-10-25 11:07:00 +0200 | [diff] [blame] | 82 | #define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/ |
Holger Brunck | 6ef6486 | 2012-07-05 05:05:04 +0000 | [diff] [blame] | 83 | #define CONFIG_KM_PIGGY4_88E6061 |
| 84 | |
Holger Brunck | 90639fe | 2013-01-15 22:51:22 +0000 | [diff] [blame] | 85 | /* KM_SUV31 */ |
| 86 | #elif defined(CONFIG_KM_SUV31) |
Heiko Schocher | ea818db | 2013-01-29 08:53:15 +0100 | [diff] [blame] | 87 | #define CONFIG_KM_IVM_BUS 1 /* I2C2 (Mux-Port 1)*/ |
Holger Brunck | 90639fe | 2013-01-15 22:51:22 +0000 | [diff] [blame] | 88 | #define CONFIG_IDENT_STRING "\nKeymile SUV31" |
| 89 | #define CONFIG_HOSTNAME kmsuv31 |
| 90 | #define CONFIG_KM_ENV_IS_IN_SPI_NOR |
| 91 | #define CONFIG_KM_FPGA_CONFIG |
| 92 | |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 93 | #else |
| 94 | #error ("Board unsupported") |
| 95 | #endif |
| 96 | |
Heiko Schocher | 67fa8c2 | 2010-02-22 16:43:02 +0530 | [diff] [blame] | 97 | /* include common defines/options for all arm based Keymile boards */ |
Valentin Longchamp | 264eaa0 | 2011-05-04 01:47:33 +0000 | [diff] [blame] | 98 | #include "km/km_arm.h" |
Heiko Schocher | 67fa8c2 | 2010-02-22 16:43:02 +0530 | [diff] [blame] | 99 | |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 100 | #ifndef CONFIG_KM_ENV_IS_IN_SPI_NOR |
Heiko Schocher | ea818db | 2013-01-29 08:53:15 +0100 | [diff] [blame] | 101 | #define KM_ENV_BUS 5 /* I2C2 (Mux-Port 5)*/ |
Holger Brunck | 8170aef | 2012-07-05 05:37:46 +0000 | [diff] [blame] | 102 | #endif |
| 103 | |
| 104 | #if defined(CONFIG_KM_PIGGY4_88E6352) |
| 105 | /* |
| 106 | * Some keymile boards like mgcoge5un & nusa1 have their PIGGY4 connected via |
| 107 | * an Marvell 88E6352 simple switch. |
| 108 | * In this case we have to change the default settings for the etherent mac. |
| 109 | * There is NO ethernet phy. The ARM and Switch are conencted directly over |
| 110 | * RGMII in MAC-MAC mode |
| 111 | * In this case 1GBit full duplex and autoneg off |
| 112 | */ |
| 113 | #define PORT_SERIAL_CONTROL_VALUE ( \ |
| 114 | MVGBE_FORCE_LINK_PASS | \ |
| 115 | MVGBE_DIS_AUTO_NEG_FOR_DUPLX | \ |
| 116 | MVGBE_DIS_AUTO_NEG_FOR_FLOW_CTRL | \ |
| 117 | MVGBE_ADV_NO_FLOW_CTRL | \ |
| 118 | MVGBE_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \ |
| 119 | MVGBE_FORCE_BP_MODE_NO_JAM | \ |
| 120 | (1 << 9) /* Reserved bit has to be 1 */ | \ |
| 121 | MVGBE_DO_NOT_FORCE_LINK_FAIL | \ |
| 122 | MVGBE_DIS_AUTO_NEG_SPEED_GMII | \ |
| 123 | MVGBE_DTE_ADV_0 | \ |
| 124 | MVGBE_MIIPHY_MAC_MODE | \ |
| 125 | MVGBE_AUTO_NEG_NO_CHANGE | \ |
| 126 | MVGBE_MAX_RX_PACKET_1552BYTE | \ |
| 127 | MVGBE_CLR_EXT_LOOPBACK | \ |
| 128 | MVGBE_SET_FULL_DUPLEX_MODE | \ |
| 129 | MVGBE_EN_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX |\ |
| 130 | MVGBE_SET_GMII_SPEED_TO_1000 |\ |
| 131 | MVGBE_SET_MII_SPEED_TO_100) |
| 132 | |
| 133 | #endif |
Heiko Schocher | 731b968 | 2011-03-08 10:53:51 +0100 | [diff] [blame] | 134 | |
Holger Brunck | f945439 | 2012-07-05 05:05:03 +0000 | [diff] [blame] | 135 | #ifdef CONFIG_KM_PIGGY4_88E6061 |
| 136 | /* |
| 137 | * Some keymile boards like mgcoge3un have their PIGGY4 connected via |
| 138 | * an Marvell 88E6061 simple switch. |
| 139 | * In this case we have to change the default settings for the |
| 140 | * ethernet phy connected to the kirkwood. |
| 141 | * In this case 100MB full duplex and autoneg off |
| 142 | */ |
| 143 | #define PORT_SERIAL_CONTROL_VALUE ( \ |
| 144 | MVGBE_FORCE_LINK_PASS | \ |
| 145 | MVGBE_DIS_AUTO_NEG_FOR_DUPLX | \ |
| 146 | MVGBE_DIS_AUTO_NEG_FOR_FLOW_CTRL | \ |
| 147 | MVGBE_ADV_NO_FLOW_CTRL | \ |
| 148 | MVGBE_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \ |
| 149 | MVGBE_FORCE_BP_MODE_NO_JAM | \ |
| 150 | (1 << 9) /* Reserved bit has to be 1 */ | \ |
| 151 | MVGBE_DO_NOT_FORCE_LINK_FAIL | \ |
| 152 | MVGBE_DIS_AUTO_NEG_SPEED_GMII | \ |
| 153 | MVGBE_DTE_ADV_0 | \ |
| 154 | MVGBE_MIIPHY_MAC_MODE | \ |
| 155 | MVGBE_AUTO_NEG_NO_CHANGE | \ |
| 156 | MVGBE_MAX_RX_PACKET_1552BYTE | \ |
| 157 | MVGBE_CLR_EXT_LOOPBACK | \ |
| 158 | MVGBE_SET_FULL_DUPLEX_MODE | \ |
| 159 | MVGBE_DIS_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX |\ |
| 160 | MVGBE_SET_GMII_SPEED_TO_10_100 |\ |
| 161 | MVGBE_SET_MII_SPEED_TO_100) |
| 162 | #endif |
| 163 | |
Holger Brunck | f945439 | 2012-07-05 05:05:03 +0000 | [diff] [blame] | 164 | #ifdef CONFIG_KM_DISABLE_PCI |
| 165 | #undef CONFIG_KIRKWOOD_PCIE_INIT |
| 166 | #endif |
Valentin Longchamp | b37f772 | 2012-07-05 05:05:05 +0000 | [diff] [blame] | 167 | |
Valentin Longchamp | b37f772 | 2012-07-05 05:05:05 +0000 | [diff] [blame] | 168 | |
Holger Brunck | 83b40c3 | 2011-06-16 18:11:15 +0530 | [diff] [blame] | 169 | #endif /* _CONFIG_KM_KIRKWOOD */ |