Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 2 | /* |
| 3 | * |
| 4 | * Read FactorySet information from EEPROM into global structure. |
| 5 | * (C) Copyright 2013 Siemens Schweiz AG |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #if !defined(CONFIG_SPL_BUILD) |
| 9 | |
Simon Glass | 5e6201b | 2019-08-01 09:46:51 -0600 | [diff] [blame] | 10 | #include <env.h> |
Enrico Leto | fce9179 | 2024-01-24 15:43:54 +0100 | [diff] [blame^] | 11 | #include <g_dnl.h> |
| 12 | #include <net.h> |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 13 | #include <asm/io.h> |
Anatolij Gustschin | 49234a3 | 2020-01-07 16:37:42 +0100 | [diff] [blame] | 14 | #if !CONFIG_IS_ENABLED(TARGET_GIEDI) && !CONFIG_IS_ENABLED(TARGET_DENEB) |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 15 | #include <asm/arch/cpu.h> |
Anatolij Gustschin | 49234a3 | 2020-01-07 16:37:42 +0100 | [diff] [blame] | 16 | #endif |
Enrico Leto | 096bfdc | 2024-01-24 15:43:49 +0100 | [diff] [blame] | 17 | #include "eeprom.h" |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 18 | #include "factoryset.h" |
| 19 | |
Enrico Leto | 096bfdc | 2024-01-24 15:43:49 +0100 | [diff] [blame] | 20 | #define EEPR_PG_SZ 0x80 |
| 21 | #define OFF_PG (SIEMENS_EE_ADDR_FACTORYSET / EEPR_PG_SZ) |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 22 | |
| 23 | /* Global variable that contains necessary information from FactorySet */ |
| 24 | struct factorysetcontainer factory_dat; |
| 25 | |
| 26 | #define fact_get_char(i) *((char *)&eeprom_buf[i]) |
| 27 | |
| 28 | static int fact_match(unsigned char *eeprom_buf, uchar *s1, int i2) |
| 29 | { |
| 30 | if (s1 == NULL) |
| 31 | return -1; |
| 32 | |
| 33 | while (*s1 == fact_get_char(i2++)) |
| 34 | if (*s1++ == '=') |
| 35 | return i2; |
| 36 | |
| 37 | if (*s1 == '\0' && fact_get_char(i2-1) == '=') |
| 38 | return i2; |
| 39 | |
| 40 | return -1; |
| 41 | } |
| 42 | |
| 43 | static int get_factory_val(unsigned char *eeprom_buf, int size, uchar *name, |
| 44 | uchar *buf, int len) |
| 45 | { |
| 46 | int i, nxt = 0; |
| 47 | |
| 48 | for (i = 0; fact_get_char(i) != '\0'; i = nxt + 1) { |
| 49 | int val, n; |
| 50 | |
| 51 | for (nxt = i; fact_get_char(nxt) != '\0'; ++nxt) { |
| 52 | if (nxt >= size) |
| 53 | return -1; |
| 54 | } |
| 55 | |
| 56 | val = fact_match(eeprom_buf, (uchar *)name, i); |
| 57 | if (val < 0) |
| 58 | continue; |
| 59 | |
| 60 | /* found; copy out */ |
| 61 | for (n = 0; n < len; ++n, ++buf) { |
| 62 | *buf = fact_get_char(val++); |
| 63 | if (*buf == '\0') |
| 64 | return n; |
| 65 | } |
| 66 | |
| 67 | if (n) |
| 68 | *--buf = '\0'; |
| 69 | |
| 70 | printf("env_buf [%d bytes] too small for value of \"%s\"\n", |
| 71 | len, name); |
| 72 | |
| 73 | return n; |
| 74 | } |
| 75 | return -1; |
| 76 | } |
| 77 | |
| 78 | static |
| 79 | int get_factory_record_val(unsigned char *eeprom_buf, int size, uchar *record, |
| 80 | uchar *name, uchar *buf, int len) |
| 81 | { |
| 82 | int ret = -1; |
| 83 | int i, nxt = 0; |
| 84 | int c; |
| 85 | unsigned char end = 0xff; |
Heiko Schocher | 6596b85 | 2014-11-18 11:51:04 +0100 | [diff] [blame] | 86 | unsigned char tmp; |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 87 | |
| 88 | for (i = 0; fact_get_char(i) != end; i = nxt) { |
| 89 | nxt = i + 1; |
| 90 | if (fact_get_char(i) == '>') { |
| 91 | int pos; |
| 92 | int endpos; |
| 93 | int z; |
Heiko Schocher | 6596b85 | 2014-11-18 11:51:04 +0100 | [diff] [blame] | 94 | int level = 0; |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 95 | |
| 96 | c = strncmp((char *)&eeprom_buf[i + 1], (char *)record, |
| 97 | strlen((char *)record)); |
| 98 | if (c == 0) { |
| 99 | /* record found */ |
| 100 | pos = i + strlen((char *)record) + 2; |
| 101 | nxt = pos; |
| 102 | /* search for "<" */ |
| 103 | c = -1; |
| 104 | for (z = pos; fact_get_char(z) != end; z++) { |
Heiko Schocher | 6596b85 | 2014-11-18 11:51:04 +0100 | [diff] [blame] | 105 | if (fact_get_char(z) == '<') { |
| 106 | if (level == 0) { |
| 107 | endpos = z; |
| 108 | nxt = endpos; |
| 109 | c = 0; |
| 110 | break; |
| 111 | } else { |
| 112 | level--; |
| 113 | } |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 114 | } |
Heiko Schocher | 6596b85 | 2014-11-18 11:51:04 +0100 | [diff] [blame] | 115 | if (fact_get_char(z) == '>') |
| 116 | level++; |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 117 | } |
Heiko Schocher | 6596b85 | 2014-11-18 11:51:04 +0100 | [diff] [blame] | 118 | } else { |
| 119 | continue; |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 120 | } |
| 121 | if (c == 0) { |
| 122 | /* end found -> call get_factory_val */ |
Heiko Schocher | 6596b85 | 2014-11-18 11:51:04 +0100 | [diff] [blame] | 123 | tmp = eeprom_buf[endpos]; |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 124 | eeprom_buf[endpos] = end; |
| 125 | ret = get_factory_val(&eeprom_buf[pos], |
Heiko Schocher | 6596b85 | 2014-11-18 11:51:04 +0100 | [diff] [blame] | 126 | endpos - pos, name, buf, len); |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 127 | /* fix buffer */ |
Heiko Schocher | 6596b85 | 2014-11-18 11:51:04 +0100 | [diff] [blame] | 128 | eeprom_buf[endpos] = tmp; |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 129 | debug("%s: %s.%s = %s\n", |
| 130 | __func__, record, name, buf); |
| 131 | return ret; |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | return ret; |
| 136 | } |
| 137 | |
| 138 | int factoryset_read_eeprom(int i2c_addr) |
| 139 | { |
| 140 | int i, pages = 0, size = 0; |
| 141 | unsigned char eeprom_buf[0x3c00], hdr[4], buf[MAX_STRING_LENGTH]; |
| 142 | unsigned char *cp, *cp1; |
| 143 | |
Marek Vasut | 7f8d436 | 2018-02-16 16:41:18 +0100 | [diff] [blame] | 144 | #if defined(CONFIG_DFU_OVER_USB) |
Maxime Ripard | 7f78b9d | 2017-09-07 08:58:08 +0200 | [diff] [blame] | 145 | factory_dat.usb_vendor_id = CONFIG_USB_GADGET_VENDOR_NUM; |
| 146 | factory_dat.usb_product_id = CONFIG_USB_GADGET_PRODUCT_NUM; |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 147 | #endif |
Anatolij Gustschin | d0d75f5 | 2019-07-10 19:44:15 +0200 | [diff] [blame] | 148 | |
Enrico Leto | 32f433f | 2024-01-24 15:43:50 +0100 | [diff] [blame] | 149 | if (siemens_ee_read_data(SIEMENS_EE_ADDR_FACTORYSET, hdr, sizeof(hdr))) |
Anatolij Gustschin | d0d75f5 | 2019-07-10 19:44:15 +0200 | [diff] [blame] | 150 | goto err; |
| 151 | |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 152 | if ((hdr[0] != 0x99) || (hdr[1] != 0x80)) { |
| 153 | printf("FactorySet is not right in eeprom.\n"); |
| 154 | return 1; |
| 155 | } |
| 156 | |
| 157 | /* get FactorySet size */ |
| 158 | size = (hdr[2] << 8) + hdr[3] + sizeof(hdr); |
| 159 | if (size > 0x3bfa) |
| 160 | size = 0x3bfa; |
| 161 | |
| 162 | pages = size / EEPR_PG_SZ; |
| 163 | |
| 164 | /* |
| 165 | * read the eeprom using i2c |
| 166 | * I can not read entire eeprom in once, so separate into several |
| 167 | * times. Furthermore, fetch eeprom take longer time, so we fetch |
| 168 | * data after every time we got a record from eeprom |
| 169 | */ |
| 170 | debug("Read eeprom page :\n"); |
Enrico Leto | 32f433f | 2024-01-24 15:43:50 +0100 | [diff] [blame] | 171 | for (i = 0; i < pages; i++) |
| 172 | if (siemens_ee_read_data((OFF_PG + i) * EEPR_PG_SZ, |
| 173 | eeprom_buf + (i * EEPR_PG_SZ), EEPR_PG_SZ)) |
Anatolij Gustschin | d0d75f5 | 2019-07-10 19:44:15 +0200 | [diff] [blame] | 174 | goto err; |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 175 | |
Enrico Leto | 32f433f | 2024-01-24 15:43:50 +0100 | [diff] [blame] | 176 | if (size % EEPR_PG_SZ) |
| 177 | if (siemens_ee_read_data((OFF_PG + pages) * EEPR_PG_SZ, |
| 178 | eeprom_buf + (pages * EEPR_PG_SZ), |
| 179 | size % EEPR_PG_SZ)) |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 180 | goto err; |
| 181 | |
| 182 | /* we do below just for eeprom align */ |
| 183 | for (i = 0; i < size; i++) |
| 184 | if (eeprom_buf[i] == '\n') |
| 185 | eeprom_buf[i] = 0; |
| 186 | |
| 187 | /* skip header */ |
| 188 | size -= sizeof(hdr); |
| 189 | cp = (uchar *)eeprom_buf + sizeof(hdr); |
| 190 | |
| 191 | /* get mac address */ |
| 192 | get_factory_record_val(cp, size, (uchar *)"ETH1", (uchar *)"mac", |
| 193 | buf, MAX_STRING_LENGTH); |
| 194 | cp1 = buf; |
| 195 | for (i = 0; i < 6; i++) { |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 196 | factory_dat.mac[i] = hextoul((char *)cp1, NULL); |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 197 | cp1 += 3; |
| 198 | } |
| 199 | |
Anatolij Gustschin | 8e9821e | 2019-07-10 19:44:16 +0200 | [diff] [blame] | 200 | #if CONFIG_IS_ENABLED(TARGET_GIEDI) || CONFIG_IS_ENABLED(TARGET_DENEB) |
| 201 | /* get mac address for WLAN */ |
Enrico Leto | 32f433f | 2024-01-24 15:43:50 +0100 | [diff] [blame] | 202 | if (get_factory_record_val(cp, size, (uchar *)"WLAN1", (uchar *)"mac", |
| 203 | buf, MAX_STRING_LENGTH) > 0) { |
Anatolij Gustschin | 8e9821e | 2019-07-10 19:44:16 +0200 | [diff] [blame] | 204 | cp1 = buf; |
| 205 | for (i = 0; i < 6; i++) { |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 206 | factory_dat.mac_wlan[i] = hextoul((char *)cp1, NULL); |
Anatolij Gustschin | 8e9821e | 2019-07-10 19:44:16 +0200 | [diff] [blame] | 207 | cp1 += 3; |
| 208 | } |
| 209 | } |
| 210 | #endif |
| 211 | |
Marek Vasut | 7f8d436 | 2018-02-16 16:41:18 +0100 | [diff] [blame] | 212 | #if defined(CONFIG_DFU_OVER_USB) |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 213 | /* read vid and pid for dfu mode */ |
| 214 | if (0 <= get_factory_record_val(cp, size, (uchar *)"USBD1", |
| 215 | (uchar *)"vid", buf, |
| 216 | MAX_STRING_LENGTH)) { |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 217 | factory_dat.usb_vendor_id = hextoul((char *)buf, NULL); |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | if (0 <= get_factory_record_val(cp, size, (uchar *)"USBD1", |
| 221 | (uchar *)"pid", buf, |
| 222 | MAX_STRING_LENGTH)) { |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 223 | factory_dat.usb_product_id = hextoul((char *)buf, NULL); |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 224 | } |
| 225 | printf("DFU USB: VID = 0x%4x, PID = 0x%4x\n", factory_dat.usb_vendor_id, |
| 226 | factory_dat.usb_product_id); |
| 227 | #endif |
Samuel Egli | 8069bfe | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 228 | if (0 <= get_factory_record_val(cp, size, (uchar *)"DEV", |
| 229 | (uchar *)"num", factory_dat.serial, |
| 230 | MAX_STRING_LENGTH)) { |
| 231 | debug("serial number: %s\n", factory_dat.serial); |
| 232 | } |
| 233 | if (0 <= get_factory_record_val(cp, size, (uchar *)"DEV", |
| 234 | (uchar *)"ver", buf, |
| 235 | MAX_STRING_LENGTH)) { |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 236 | factory_dat.version = hextoul((char *)buf, NULL); |
Samuel Egli | 8069bfe | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 237 | debug("version number: %d\n", factory_dat.version); |
| 238 | } |
Heiko Schocher | faf2dc6 | 2014-11-18 11:51:06 +0100 | [diff] [blame] | 239 | /* Get ASN from factory set if available */ |
| 240 | if (0 <= get_factory_record_val(cp, size, (uchar *)"DEV", |
| 241 | (uchar *)"id", factory_dat.asn, |
| 242 | MAX_STRING_LENGTH)) { |
| 243 | debug("factoryset asn: %s\n", factory_dat.asn); |
| 244 | } else { |
| 245 | factory_dat.asn[0] = 0; |
| 246 | } |
Heiko Schocher | 7b90565 | 2014-11-18 11:51:05 +0100 | [diff] [blame] | 247 | /* Get COMP/ver from factory set if available */ |
| 248 | if (0 <= get_factory_record_val(cp, size, (uchar *)"COMP", |
| 249 | (uchar *)"ver", |
| 250 | factory_dat.comp_version, |
| 251 | MAX_STRING_LENGTH)) { |
| 252 | debug("factoryset COMP/ver: %s\n", factory_dat.comp_version); |
| 253 | } else { |
| 254 | strcpy((char *)factory_dat.comp_version, "1.0"); |
| 255 | } |
| 256 | |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 257 | return 0; |
| 258 | |
| 259 | err: |
| 260 | printf("Could not read the EEPROM; something fundamentally wrong on the I2C bus.\n"); |
| 261 | return 1; |
| 262 | } |
| 263 | |
Anatolij Gustschin | 8e9821e | 2019-07-10 19:44:16 +0200 | [diff] [blame] | 264 | static int get_mac_from_efuse(uint8_t mac[6]) |
| 265 | { |
| 266 | #ifdef CONFIG_AM33XX |
| 267 | struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; |
| 268 | uint32_t mac_hi, mac_lo; |
| 269 | |
| 270 | mac_lo = readl(&cdev->macid0l); |
| 271 | mac_hi = readl(&cdev->macid0h); |
| 272 | |
| 273 | mac[0] = mac_hi & 0xFF; |
| 274 | mac[1] = (mac_hi & 0xFF00) >> 8; |
| 275 | mac[2] = (mac_hi & 0xFF0000) >> 16; |
| 276 | mac[3] = (mac_hi & 0xFF000000) >> 24; |
| 277 | mac[4] = mac_lo & 0xFF; |
| 278 | mac[5] = (mac_lo & 0xFF00) >> 8; |
| 279 | #else |
| 280 | /* unhandled */ |
| 281 | memset(mac, 0, 6); |
| 282 | #endif |
| 283 | if (!is_valid_ethaddr(mac)) { |
| 284 | puts("Warning: ethaddr not set by FactorySet or E-fuse. "); |
| 285 | puts("Set <ethaddr> variable to overcome this.\n"); |
| 286 | return -1; |
| 287 | } |
| 288 | return 0; |
| 289 | } |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 290 | |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 291 | static int factoryset_mac_env_set(void) |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 292 | { |
| 293 | uint8_t mac_addr[6]; |
| 294 | |
Anatolij Gustschin | 8e9821e | 2019-07-10 19:44:16 +0200 | [diff] [blame] | 295 | /* Set mac from factoryset or try reading E-fuse */ |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 296 | debug("FactorySet: Set mac address\n"); |
Joe Hershberger | 8ecdbed | 2015-04-08 01:41:04 -0500 | [diff] [blame] | 297 | if (is_valid_ethaddr(factory_dat.mac)) { |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 298 | memcpy(mac_addr, factory_dat.mac, 6); |
| 299 | } else { |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 300 | debug("Warning: FactorySet: <ethaddr> not set. Fallback to E-fuse\n"); |
Anatolij Gustschin | 8e9821e | 2019-07-10 19:44:16 +0200 | [diff] [blame] | 301 | if (get_mac_from_efuse(mac_addr) < 0) |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 302 | return -1; |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 303 | } |
| 304 | |
Simon Glass | 8551d55 | 2017-08-03 12:22:11 -0600 | [diff] [blame] | 305 | eth_env_set_enetaddr("ethaddr", mac_addr); |
Anatolij Gustschin | 8e9821e | 2019-07-10 19:44:16 +0200 | [diff] [blame] | 306 | |
| 307 | #if CONFIG_IS_ENABLED(TARGET_GIEDI) || CONFIG_IS_ENABLED(TARGET_DENEB) |
| 308 | eth_env_set_enetaddr("eth1addr", mac_addr); |
| 309 | |
| 310 | /* wlan mac */ |
| 311 | if (is_valid_ethaddr(factory_dat.mac_wlan)) |
| 312 | eth_env_set_enetaddr("eth2addr", factory_dat.mac_wlan); |
| 313 | #endif |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 314 | return 0; |
| 315 | } |
| 316 | |
Anatolij Gustschin | 8e9821e | 2019-07-10 19:44:16 +0200 | [diff] [blame] | 317 | static void factoryset_dtb_env_set(void) |
| 318 | { |
| 319 | /* Set ASN in environment*/ |
| 320 | if (factory_dat.asn[0] != 0) { |
| 321 | env_set("dtb_name", (char *)factory_dat.asn); |
| 322 | } else { |
| 323 | /* dtb suffix gets added in load script */ |
| 324 | env_set("dtb_name", "default"); |
| 325 | } |
| 326 | } |
| 327 | |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 328 | int factoryset_env_set(void) |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 329 | { |
| 330 | int ret = 0; |
| 331 | |
Anatolij Gustschin | 8e9821e | 2019-07-10 19:44:16 +0200 | [diff] [blame] | 332 | factoryset_dtb_env_set(); |
| 333 | |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 334 | if (factoryset_mac_env_set() < 0) |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 335 | ret = -1; |
| 336 | |
| 337 | return ret; |
| 338 | } |
| 339 | |
Lukasz Majewski | 44b5b38 | 2013-10-08 14:30:41 +0200 | [diff] [blame] | 340 | int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 341 | { |
| 342 | put_unaligned(factory_dat.usb_vendor_id, &dev->idVendor); |
| 343 | put_unaligned(factory_dat.usb_product_id, &dev->idProduct); |
Samuel Egli | 8069bfe | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 344 | g_dnl_set_serialnumber((char *)factory_dat.serial); |
| 345 | |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 346 | return 0; |
| 347 | } |
Samuel Egli | 8069bfe | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 348 | |
| 349 | int g_dnl_get_board_bcd_device_number(int gcnum) |
| 350 | { |
| 351 | return factory_dat.version; |
| 352 | } |
Heiko Schocher | 499c498 | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 353 | #endif /* defined(CONFIG_SPL_BUILD) */ |