Skip to content

Commit

Permalink
ARM: sa1100: Refactor mcp-sa11x0 to use platform resources.
Browse files Browse the repository at this point in the history
Make use of memory resources rather than hardcoded IO adresses.
This is a first step towards DT support.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Jochen Friedrich authored and Samuel Ortiz committed Jan 8, 2012
1 parent 5dd7bf5 commit af9081a
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 53 deletions.
11 changes: 11 additions & 0 deletions arch/arm/mach-sa1100/assabet.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,17 @@ static void __init assabet_init(void)
sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources,
ARRAY_SIZE(assabet_flash_resources));
sa11x0_register_irda(&assabet_irda_data);

/*
* Setup the PPC unit correctly.
*/
PPDR &= ~PPC_RXD4;
PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
PSDR |= PPC_RXD4;
PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);

ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);
sa11x0_register_mcp(&assabet_mcp_data);
}

Expand Down
10 changes: 10 additions & 0 deletions arch/arm/mach-sa1100/cerf.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ static void __init cerf_init(void)
{
platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
sa11x0_register_mtd(&cerf_flash_data, &cerf_flash_resource, 1);

/*
* Setup the PPC unit correctly.
*/
PPDR &= ~PPC_RXD4;
PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
PSDR |= PPC_RXD4;
PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);

sa11x0_register_mcp(&cerf_mcp_data);
}

Expand Down
10 changes: 10 additions & 0 deletions arch/arm/mach-sa1100/collie.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,16 @@ static void __init collie_init(void)

sa11x0_register_mtd(&collie_flash_data, collie_flash_resources,
ARRAY_SIZE(collie_flash_resources));

/*
* Setup the PPC unit correctly.
*/
PPDR &= ~PPC_RXD4;
PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
PSDR |= PPC_RXD4;
PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);

sa11x0_register_mcp(&collie_mcp_data);

sharpsl_save_param();
Expand Down
7 changes: 6 additions & 1 deletion arch/arm/mach-sa1100/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,15 @@ static struct platform_device sa11x0uart3_device = {
static struct resource sa11x0mcp_resources[] = {
[0] = {
.start = __PREG(Ser4MCCR0),
.end = __PREG(Ser4MCCR0) + 0xffff,
.end = __PREG(Ser4MCCR0) + 0x1C - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = __PREG(Ser4MCCR1),
.end = __PREG(Ser4MCCR1) + 0x4 - 1,
.flags = IORESOURCE_MEM,
},
[2] = {
.start = IRQ_Ser4MCP,
.end = IRQ_Ser4MCP,
.flags = IORESOURCE_IRQ,
Expand Down
9 changes: 9 additions & 0 deletions arch/arm/mach-sa1100/lart.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ static struct mcp_plat_data lart_mcp_data = {

static void __init lart_init(void)
{
/*
* Setup the PPC unit correctly.
*/
PPDR &= ~PPC_RXD4;
PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
PSDR |= PPC_RXD4;
PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);

sa11x0_register_mcp(&lart_mcp_data);
}

Expand Down
10 changes: 10 additions & 0 deletions arch/arm/mach-sa1100/shannon.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ static struct mcp_plat_data shannon_mcp_data = {
static void __init shannon_init(void)
{
sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1);

/*
* Setup the PPC unit correctly.
*/
PPDR &= ~PPC_RXD4;
PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
PSDR |= PPC_RXD4;
PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);

sa11x0_register_mcp(&shannon_mcp_data);
}

Expand Down
10 changes: 10 additions & 0 deletions arch/arm/mach-sa1100/simpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ static int __init simpad_init(void)

sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources,
ARRAY_SIZE(simpad_flash_resources));

/*
* Setup the PPC unit correctly.
*/
PPDR &= ~PPC_RXD4;
PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
PSDR |= PPC_RXD4;
PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);

sa11x0_register_mcp(&simpad_mcp_data);

ret = platform_add_devices(devices, ARRAY_SIZE(devices));
Expand Down
Loading

0 comments on commit af9081a

Please sign in to comment.