wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Cirrus Logic CS8900A Ethernet |
| 3 | * |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 4 | * (C) 2003 Wolfgang Denk, wd@denx.de |
| 5 | * Extension to synchronize ethaddr environment variable |
| 6 | * against value in EEPROM |
| 7 | * |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 8 | * (C) Copyright 2002 |
| 9 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 10 | * Marius Groeger <mgroeger@sysgo.de> |
| 11 | * |
| 12 | * Copyright (C) 1999 Ben Williamson <benw@pobox.com> |
| 13 | * |
| 14 | * See file CREDITS for list of people who contributed to this |
| 15 | * project. |
| 16 | * |
| 17 | * This program is loaded into SRAM in bootstrap mode, where it waits |
| 18 | * for commands on UART1 to read and write memory, jump to code etc. |
| 19 | * A design goal for this program is to be entirely independent of the |
| 20 | * target board. Anything with a CL-PS7111 or EP7211 should be able to run |
| 21 | * this code in bootstrap mode. All the board specifics can be handled on |
| 22 | * the host. |
| 23 | * |
| 24 | * This program is free software; you can redistribute it and/or modify |
| 25 | * it under the terms of the GNU General Public License as published by |
| 26 | * the Free Software Foundation; either version 2 of the License, or |
| 27 | * (at your option) any later version. |
| 28 | * |
| 29 | * This program is distributed in the hope that it will be useful, |
| 30 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 31 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 32 | * GNU General Public License for more details. |
| 33 | * |
| 34 | * You should have received a copy of the GNU General Public License |
| 35 | * along with this program; if not, write to the Free Software |
| 36 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 37 | */ |
| 38 | |
| 39 | #include <common.h> |
| 40 | #include <command.h> |
| 41 | #include "cs8900.h" |
| 42 | #include <net.h> |
| 43 | |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 44 | #undef DEBUG |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 45 | |
| 46 | /* packet page register access functions */ |
| 47 | |
| 48 | #ifdef CS8900_BUS32 |
| 49 | /* we don't need 16 bit initialisation on 32 bit bus */ |
| 50 | #define get_reg_init_bus(x) get_reg((x)) |
| 51 | #else |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 52 | static unsigned short get_reg_init_bus (int regno) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 53 | { |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 54 | /* force 16 bit busmode */ |
| 55 | volatile unsigned char c; |
| 56 | |
| 57 | c = CS8900_BUS16_0; |
| 58 | c = CS8900_BUS16_1; |
| 59 | c = CS8900_BUS16_0; |
| 60 | c = CS8900_BUS16_1; |
| 61 | c = CS8900_BUS16_0; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 62 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 63 | CS8900_PPTR = regno; |
Guennadi Liakhovetski | fddcc0c | 2008-04-03 13:36:18 +0200 | [diff] [blame] | 64 | return CS8900_PDATA; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 65 | } |
| 66 | #endif |
| 67 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 68 | static unsigned short get_reg (int regno) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 69 | { |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 70 | CS8900_PPTR = regno; |
Guennadi Liakhovetski | fddcc0c | 2008-04-03 13:36:18 +0200 | [diff] [blame] | 71 | return CS8900_PDATA; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 75 | static void put_reg (int regno, unsigned short val) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 76 | { |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 77 | CS8900_PPTR = regno; |
| 78 | CS8900_PDATA = val; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 79 | } |
| 80 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 81 | static void eth_reset (void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 82 | { |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 83 | int tmo; |
| 84 | unsigned short us; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 85 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 86 | /* reset NIC */ |
| 87 | put_reg (PP_SelfCTL, get_reg (PP_SelfCTL) | PP_SelfCTL_Reset); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 88 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 89 | /* wait for 200ms */ |
| 90 | udelay (200000); |
| 91 | /* Wait until the chip is reset */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 92 | |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 93 | tmo = get_timer (0) + 1 * CONFIG_SYS_HZ; |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 94 | while ((((us = get_reg_init_bus (PP_SelfSTAT)) & PP_SelfSTAT_InitD) == 0) |
| 95 | && tmo < get_timer (0)) |
| 96 | /*NOP*/; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 97 | } |
| 98 | |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 99 | static void eth_reginit (void) |
| 100 | { |
| 101 | /* receive only error free packets addressed to this card */ |
| 102 | put_reg (PP_RxCTL, PP_RxCTL_IA | PP_RxCTL_Broadcast | PP_RxCTL_RxOK); |
| 103 | /* do not generate any interrupts on receive operations */ |
| 104 | put_reg (PP_RxCFG, 0); |
| 105 | /* do not generate any interrupts on transmit operations */ |
| 106 | put_reg (PP_TxCFG, 0); |
| 107 | /* do not generate any interrupts on buffer operations */ |
| 108 | put_reg (PP_BufCFG, 0); |
| 109 | /* enable transmitter/receiver mode */ |
| 110 | put_reg (PP_LineCTL, PP_LineCTL_Rx | PP_LineCTL_Tx); |
| 111 | } |
| 112 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 113 | void cs8900_get_enetaddr (uchar * addr) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 114 | { |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 115 | int i; |
| 116 | unsigned char env_enetaddr[6]; |
| 117 | char *tmp = getenv ("ethaddr"); |
| 118 | char *end; |
| 119 | |
| 120 | for (i=0; i<6; i++) { |
| 121 | env_enetaddr[i] = tmp ? simple_strtoul(tmp, &end, 16) : 0; |
| 122 | if (tmp) |
| 123 | tmp = (*end) ? end+1 : end; |
| 124 | } |
| 125 | |
| 126 | /* verify chip id */ |
| 127 | if (get_reg_init_bus (PP_ChipID) != 0x630e) |
| 128 | return; |
| 129 | eth_reset (); |
Guennadi Liakhovetski | fddcc0c | 2008-04-03 13:36:18 +0200 | [diff] [blame] | 130 | if ((get_reg (PP_SelfSTAT) & (PP_SelfSTAT_EEPROM | PP_SelfSTAT_EEPROM_OK)) == |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 131 | (PP_SelfSTAT_EEPROM | PP_SelfSTAT_EEPROM_OK)) { |
| 132 | |
| 133 | /* Load the MAC from EEPROM */ |
| 134 | for (i = 0; i < 6 / 2; i++) { |
| 135 | unsigned int Addr; |
| 136 | |
| 137 | Addr = get_reg (PP_IA + i * 2); |
| 138 | addr[i * 2] = Addr & 0xFF; |
| 139 | addr[i * 2 + 1] = Addr >> 8; |
| 140 | } |
| 141 | |
| 142 | if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6) != 0 && |
| 143 | memcmp(env_enetaddr, addr, 6) != 0) { |
| 144 | printf ("\nWarning: MAC addresses don't match:\n"); |
| 145 | printf ("\tHW MAC address: " |
| 146 | "%02X:%02X:%02X:%02X:%02X:%02X\n", |
| 147 | addr[0], addr[1], |
| 148 | addr[2], addr[3], |
| 149 | addr[4], addr[5] ); |
| 150 | printf ("\t\"ethaddr\" value: " |
| 151 | "%02X:%02X:%02X:%02X:%02X:%02X\n", |
| 152 | env_enetaddr[0], env_enetaddr[1], |
| 153 | env_enetaddr[2], env_enetaddr[3], |
| 154 | env_enetaddr[4], env_enetaddr[5]) ; |
| 155 | debug ("### Set MAC addr from environment\n"); |
| 156 | memcpy (addr, env_enetaddr, 6); |
| 157 | } |
| 158 | if (!tmp) { |
| 159 | char ethaddr[20]; |
| 160 | sprintf (ethaddr, "%02X:%02X:%02X:%02X:%02X:%02X", |
| 161 | addr[0], addr[1], |
| 162 | addr[2], addr[3], |
| 163 | addr[4], addr[5]) ; |
Jean-Christophe PLAGNIOL-VILLARD | 4134872 | 2008-01-25 07:54:47 +0100 | [diff] [blame] | 164 | debug ("### Set environment from HW MAC addr = \"%s\"\n", ethaddr); |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 165 | setenv ("ethaddr", ethaddr); |
| 166 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 167 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 168 | } |
| 169 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 170 | void eth_halt (void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 171 | { |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 172 | /* disable transmitter/receiver mode */ |
| 173 | put_reg (PP_LineCTL, 0); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 174 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 175 | /* "shutdown" to show ChipID or kernel wouldn't find he cs8900 ... */ |
| 176 | get_reg_init_bus (PP_ChipID); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 177 | } |
| 178 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 179 | int eth_init (bd_t * bd) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 180 | { |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 181 | /* verify chip id */ |
| 182 | if (get_reg_init_bus (PP_ChipID) != 0x630e) { |
| 183 | printf ("CS8900 Ethernet chip not found?!\n"); |
| 184 | return 0; |
| 185 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 186 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 187 | eth_reset (); |
| 188 | /* set the ethernet address */ |
| 189 | put_reg (PP_IA + 0, bd->bi_enetaddr[0] | (bd->bi_enetaddr[1] << 8)); |
| 190 | put_reg (PP_IA + 2, bd->bi_enetaddr[2] | (bd->bi_enetaddr[3] << 8)); |
| 191 | put_reg (PP_IA + 4, bd->bi_enetaddr[4] | (bd->bi_enetaddr[5] << 8)); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 192 | |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 193 | eth_reginit (); |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 194 | return 0; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | /* Get a data block via Ethernet */ |
Guennadi Liakhovetski | fddcc0c | 2008-04-03 13:36:18 +0200 | [diff] [blame] | 198 | int eth_rx (void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 199 | { |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 200 | int i; |
| 201 | unsigned short rxlen; |
| 202 | unsigned short *addr; |
| 203 | unsigned short status; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 204 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 205 | status = get_reg (PP_RER); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 206 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 207 | if ((status & PP_RER_RxOK) == 0) |
| 208 | return 0; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 209 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 210 | status = CS8900_RTDATA; /* stat */ |
| 211 | rxlen = CS8900_RTDATA; /* len */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 212 | |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 213 | #ifdef DEBUG |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 214 | if (rxlen > PKTSIZE_ALIGN + PKTALIGN) |
| 215 | printf ("packet too big!\n"); |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 216 | #endif |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 217 | for (addr = (unsigned short *) NetRxPackets[0], i = rxlen >> 1; i > 0; |
| 218 | i--) |
| 219 | *addr++ = CS8900_RTDATA; |
| 220 | if (rxlen & 1) |
| 221 | *addr++ = CS8900_RTDATA; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 222 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 223 | /* Pass the packet up to the protocol layers. */ |
| 224 | NetReceive (NetRxPackets[0], rxlen); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 225 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 226 | return rxlen; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | /* Send a data block via Ethernet. */ |
Guennadi Liakhovetski | fddcc0c | 2008-04-03 13:36:18 +0200 | [diff] [blame] | 230 | int eth_send (volatile void *packet, int length) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 231 | { |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 232 | volatile unsigned short *addr; |
| 233 | int tmo; |
| 234 | unsigned short s; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 235 | |
| 236 | retry: |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 237 | /* initiate a transmit sequence */ |
| 238 | CS8900_TxCMD = PP_TxCmd_TxStart_Full; |
| 239 | CS8900_TxLEN = length; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 240 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 241 | /* Test to see if the chip has allocated memory for the packet */ |
| 242 | if ((get_reg (PP_BusSTAT) & PP_BusSTAT_TxRDY) == 0) { |
| 243 | /* Oops... this should not happen! */ |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 244 | #ifdef DEBUG |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 245 | printf ("cs: unable to send packet; retrying...\n"); |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 246 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 247 | for (tmo = get_timer (0) + 5 * CONFIG_SYS_HZ; get_timer (0) < tmo;) |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 248 | /*NOP*/; |
| 249 | eth_reset (); |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 250 | eth_reginit (); |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 251 | goto retry; |
| 252 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 253 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 254 | /* Write the contents of the packet */ |
| 255 | /* assume even number of bytes */ |
| 256 | for (addr = packet; length > 0; length -= 2) |
| 257 | CS8900_RTDATA = *addr++; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 258 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 259 | /* wait for transfer to succeed */ |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 260 | tmo = get_timer (0) + 5 * CONFIG_SYS_HZ; |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 261 | while ((s = get_reg (PP_TER) & ~0x1F) == 0) { |
| 262 | if (get_timer (0) >= tmo) |
| 263 | break; |
| 264 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 265 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 266 | /* nothing */ ; |
| 267 | if ((s & (PP_TER_CRS | PP_TER_TxOK)) != PP_TER_TxOK) { |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 268 | #ifdef DEBUG |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 269 | printf ("\ntransmission error %#x\n", s); |
wdenk | 4ea537d | 2003-12-07 18:32:37 +0000 | [diff] [blame] | 270 | #endif |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 271 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 272 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 273 | return 0; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 274 | } |
| 275 | |
wdenk | 1fe2c70 | 2003-03-06 21:55:29 +0000 | [diff] [blame] | 276 | static void cs8900_e2prom_ready(void) |
| 277 | { |
Guennadi Liakhovetski | fddcc0c | 2008-04-03 13:36:18 +0200 | [diff] [blame] | 278 | while (get_reg(PP_SelfSTAT) & SI_BUSY) |
| 279 | ; |
wdenk | 1fe2c70 | 2003-03-06 21:55:29 +0000 | [diff] [blame] | 280 | } |
| 281 | |
| 282 | /***********************************************************/ |
| 283 | /* read a 16-bit word out of the EEPROM */ |
| 284 | /***********************************************************/ |
| 285 | |
| 286 | int cs8900_e2prom_read(unsigned char addr, unsigned short *value) |
| 287 | { |
| 288 | cs8900_e2prom_ready(); |
| 289 | put_reg(PP_EECMD, EEPROM_READ_CMD | addr); |
| 290 | cs8900_e2prom_ready(); |
| 291 | *value = get_reg(PP_EEData); |
| 292 | |
| 293 | return 0; |
| 294 | } |
| 295 | |
| 296 | |
| 297 | /***********************************************************/ |
| 298 | /* write a 16-bit word into the EEPROM */ |
| 299 | /***********************************************************/ |
| 300 | |
wdenk | 6b58f33 | 2003-03-14 20:47:52 +0000 | [diff] [blame] | 301 | int cs8900_e2prom_write(unsigned char addr, unsigned short value) |
wdenk | 1fe2c70 | 2003-03-06 21:55:29 +0000 | [diff] [blame] | 302 | { |
| 303 | cs8900_e2prom_ready(); |
| 304 | put_reg(PP_EECMD, EEPROM_WRITE_EN); |
| 305 | cs8900_e2prom_ready(); |
| 306 | put_reg(PP_EEData, value); |
| 307 | put_reg(PP_EECMD, EEPROM_WRITE_CMD | addr); |
| 308 | cs8900_e2prom_ready(); |
| 309 | put_reg(PP_EECMD, EEPROM_WRITE_DIS); |
| 310 | cs8900_e2prom_ready(); |
| 311 | |
wdenk | 6b58f33 | 2003-03-14 20:47:52 +0000 | [diff] [blame] | 312 | return 0; |
wdenk | 1fe2c70 | 2003-03-06 21:55:29 +0000 | [diff] [blame] | 313 | } |