-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS: Alchemy: Single kernel for DB1200/1300/1550
Combine support for the DB1200/PB1200, DB1300 and DB1550 boards into a single kernel image. defconfig-generated image verified on DB1200, DB1300 and DB1550. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/4335/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
- Loading branch information
Manuel Lauss
authored and
Ralf Baechle
committed
Oct 11, 2012
1 parent
748e787
commit bd8510d
Showing
13 changed files
with
548 additions
and
941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* DB1200/PB1200 / DB1550 / DB1300 board support. | ||
* | ||
* These 4 boards can reliably be supported in a single kernel image. | ||
*/ | ||
|
||
#include <asm/mach-au1x00/au1000.h> | ||
#include <asm/mach-db1x00/bcsr.h> | ||
|
||
int __init db1200_board_setup(void); | ||
int __init db1200_dev_setup(void); | ||
int __init db1300_board_setup(void); | ||
int __init db1300_dev_setup(void); | ||
int __init db1550_board_setup(void); | ||
int __init db1550_dev_setup(void); | ||
int __init db1550_pci_setup(void); | ||
|
||
static const char *board_type_str(void) | ||
{ | ||
switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) { | ||
case BCSR_WHOAMI_PB1200_DDR1: | ||
case BCSR_WHOAMI_PB1200_DDR2: | ||
return "PB1200"; | ||
case BCSR_WHOAMI_DB1200: | ||
return "DB1200"; | ||
case BCSR_WHOAMI_DB1300: | ||
return "DB1300"; | ||
case BCSR_WHOAMI_DB1550: | ||
return "DB1550"; | ||
default: | ||
return "(unknown)"; | ||
} | ||
} | ||
|
||
const char *get_system_type(void) | ||
{ | ||
return board_type_str(); | ||
} | ||
|
||
void __init board_setup(void) | ||
{ | ||
int ret; | ||
|
||
switch (alchemy_get_cputype()) { | ||
case ALCHEMY_CPU_AU1550: | ||
ret = db1550_board_setup(); | ||
break; | ||
case ALCHEMY_CPU_AU1200: | ||
ret = db1200_board_setup(); | ||
break; | ||
case ALCHEMY_CPU_AU1300: | ||
ret = db1300_board_setup(); | ||
break; | ||
default: | ||
pr_err("unsupported CPU on board\n"); | ||
ret = -ENODEV; | ||
} | ||
if (ret) | ||
panic("cannot initialize board support\n"); | ||
} | ||
|
||
int __init db1235_arch_init(void) | ||
{ | ||
if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1550) | ||
return db1550_pci_setup(); | ||
return 0; | ||
} | ||
arch_initcall(db1235_arch_init); | ||
|
||
int __init db1235_dev_init(void) | ||
{ | ||
switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) { | ||
case BCSR_WHOAMI_PB1200_DDR1: | ||
case BCSR_WHOAMI_PB1200_DDR2: | ||
case BCSR_WHOAMI_DB1200: | ||
return db1200_dev_setup(); | ||
case BCSR_WHOAMI_DB1300: | ||
return db1300_dev_setup(); | ||
case BCSR_WHOAMI_DB1550: | ||
return db1550_dev_setup(); | ||
} | ||
return 0; | ||
} | ||
device_initcall(db1235_dev_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.