aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-03-30 09:16:52 +0000
committerJohn Crispin <john@openwrt.org>2014-03-30 09:16:52 +0000
commit42e8cb6388a7f9bfd8ff820a5af9193e8fb67fa8 (patch)
treefa57ef5fc6bca28bd0487ffadbc635f4712dd3b3
parent1966d4942c2d91b225ddb820e6be01b9b1dc9652 (diff)
downloadupstream-42e8cb6388a7f9bfd8ff820a5af9193e8fb67fa8.tar.gz
upstream-42e8cb6388a7f9bfd8ff820a5af9193e8fb67fa8.tar.bz2
upstream-42e8cb6388a7f9bfd8ff820a5af9193e8fb67fa8.zip
lantiq: do an endianness swap to the RT2860 eeprom for ARV752DPW(22)
ARV7510PW22, ARV752DPW and ARV752DPW22 have the RT2860 eeprom stored in flash as big-endian, but the driver needs it in little-endian format. We have to swab it before handing it over. This requires my earlier patch for busybox. Funnily enough, ARV752DPW works also with the incorrect eeprom, but undoubtedly unoptimally. I have a hunch that also the final remaining Lantiq board would require this swabbing, but I'm not sure, so I just swab it in the three boards that I know about. v2: * Swab also on ARV7510PW22 based on feedback from Alvaro Rojas * Fix the offset with bs=2 Signed-off-by: Matti Laakso <malaakso at elisanet.fi> SVN-Revision: 40328
-rw-r--r--target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom17
1 files changed, 13 insertions, 4 deletions
diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index a849584fcf..427c5fc7a2 100644
--- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -10,6 +10,7 @@ rt2x00_eeprom_extract() {
local part=$1
local offset=$2
local count=$3
+ local swab=$4
local mtd
. /lib/functions.sh
@@ -18,8 +19,13 @@ rt2x00_eeprom_extract() {
[ -n "$mtd" ] || \
rt2x00_eeprom_die "no mtd device found for partition $part"
- dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count || \
- rt2x00_eeprom_die "failed to extract from $mtd"
+ if [ $swab -gt 0 ]; then
+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=2 skip=$offset count=$count conv=swab || \
+ rt2x00_eeprom_die "failed to extract from $mtd"
+ else
+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count || \
+ rt2x00_eeprom_die "failed to extract from $mtd"
+ fi
}
[ -e /lib/firmware/$FIRMWARE ] && exit 0
@@ -29,8 +35,11 @@ case "$FIRMWARE" in
"RT2860.eeprom" )
local board=$(lantiq_board_id)
case $board in
- ARV7510PW22|ARV7519PW|ARV7525PW|ARV752DPW|ARV752DPW22)
- rt2x00_eeprom_extract "board_config" 1040 512
+ ARV7510PW22|ARV7519PW|ARV752DPW|ARV752DPW22)
+ rt2x00_eeprom_extract "board_config" 520 256 1
+ ;;
+ ARV7525PW)
+ rt2x00_eeprom_extract "board_config" 1040 512 0
;;
*)
rt2x00_eeprom_die "board $board is not supported yet"
d='n210' href='#n210'>210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430