autodetect flash width - thanks to Kestutis Kupciunas
SVN-Revision: 6327
This commit is contained in:
parent
e32f19c986
commit
1d7bfc46ec
1 changed files with 14 additions and 0 deletions
|
@ -215,6 +215,7 @@ int __init ar5312_init_devices(void)
|
||||||
struct ar531x_boarddata *bcfg;
|
struct ar531x_boarddata *bcfg;
|
||||||
char *radio, *c;
|
char *radio, *c;
|
||||||
int dev = 0;
|
int dev = 0;
|
||||||
|
uint32_t fctl = 0;
|
||||||
|
|
||||||
if (!is_5312)
|
if (!is_5312)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -253,6 +254,19 @@ int __init ar5312_init_devices(void)
|
||||||
|
|
||||||
ar5312_eth0_data.board_config = board_config;
|
ar5312_eth0_data.board_config = board_config;
|
||||||
ar5312_eth1_data.board_config = board_config;
|
ar5312_eth1_data.board_config = board_config;
|
||||||
|
|
||||||
|
/* fixup flash width; TODO: constants -> defines */
|
||||||
|
fctl = sysRegRead(AR531X_FLASHCTL) & 0x30000000;
|
||||||
|
switch (fctl) {
|
||||||
|
case 0x20000000:
|
||||||
|
ar5312_flash_data.width = 2;
|
||||||
|
break;
|
||||||
|
case 0x00000000:
|
||||||
|
default:
|
||||||
|
ar5312_flash_data.width = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
ar5312_devs[dev++] = &ar5312_physmap_flash;
|
ar5312_devs[dev++] = &ar5312_physmap_flash;
|
||||||
|
|
||||||
if (!memcmp(bcfg->enet0Mac, "\xff\xff\xff\xff\xff\xff", 6))
|
if (!memcmp(bcfg->enet0Mac, "\xff\xff\xff\xff\xff\xff", 6))
|
||||||
|
|
Loading…
Reference in a new issue