Commit 050cbb09 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
  avr32: update default configurations for ATNGW100, ATSTK1002 and ATSTK1006
  avr32: add default configurations for ATNGW100 mkII and EVKLCD10X
  avr32: add support for ATNGW100 mkII board
  avr32: convert to asm-generic/hardirq.h
  avr32: add two new at91 to cpu.h definition
  avr32: clean up linker script using standard macros.
  avr32: MRMT: correct setup of SPI slaves
  avr32: function for independently setting up SPI slaves
  avr32: re-instate MCI WP/CD pin assignments for ATNGW100
parents 17c330f9 0386f9e6
...@@ -112,6 +112,11 @@ config CPU_AT32AP7002 ...@@ -112,6 +112,11 @@ config CPU_AT32AP7002
bool bool
select CPU_AT32AP700X select CPU_AT32AP700X
# AP700X boards
config BOARD_ATNGW100_COMMON
bool
select CPU_AT32AP7000
choice choice
prompt "AVR32 board type" prompt "AVR32 board type"
default BOARD_ATSTK1000 default BOARD_ATSTK1000
...@@ -119,9 +124,13 @@ choice ...@@ -119,9 +124,13 @@ choice
config BOARD_ATSTK1000 config BOARD_ATSTK1000
bool "ATSTK1000 evaluation board" bool "ATSTK1000 evaluation board"
config BOARD_ATNGW100 config BOARD_ATNGW100_MKI
bool "ATNGW100 Network Gateway" bool "ATNGW100 Network Gateway"
select CPU_AT32AP7000 select BOARD_ATNGW100_COMMON
config BOARD_ATNGW100_MKII
bool "ATNGW100 mkII Network Gateway"
select BOARD_ATNGW100_COMMON
config BOARD_HAMMERHEAD config BOARD_HAMMERHEAD
bool "Hammerhead board" bool "Hammerhead board"
......
...@@ -32,7 +32,7 @@ head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o ...@@ -32,7 +32,7 @@ head-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/head.o
head-y += arch/avr32/kernel/head.o head-y += arch/avr32/kernel/head.o
core-y += $(machdirs) core-y += $(machdirs)
core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/ core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/
core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/ core-$(CONFIG_BOARD_ATNGW100_COMMON) += arch/avr32/boards/atngw100/
core-$(CONFIG_BOARD_HAMMERHEAD) += arch/avr32/boards/hammerhead/ core-$(CONFIG_BOARD_HAMMERHEAD) += arch/avr32/boards/hammerhead/
core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/ core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/
core-$(CONFIG_BOARD_MERISC) += arch/avr32/boards/merisc/ core-$(CONFIG_BOARD_MERISC) += arch/avr32/boards/merisc/
......
# NGW100 customization # NGW100 customization
if BOARD_ATNGW100 if BOARD_ATNGW100_COMMON
config BOARD_ATNGW100_MKII_LCD
bool "Enable ATNGW100 mkII LCD interface"
depends on BOARD_ATNGW100_MKII
help
This enables the LCD controller (LCDC) in the AT32AP7000. Since the
LCDC is multiplexed with MACB1 (LAN) Ethernet port, only one can be
enabled at a time.
This choice enables the LCDC and disables the MACB1 interface marked
LAN on the PCB.
choice choice
prompt "Select an NGW100 add-on board to support" prompt "Select an NGW100 add-on board to support"
...@@ -11,15 +22,11 @@ config BOARD_ATNGW100_ADDON_NONE ...@@ -11,15 +22,11 @@ config BOARD_ATNGW100_ADDON_NONE
config BOARD_ATNGW100_EVKLCD10X config BOARD_ATNGW100_EVKLCD10X
bool "EVKLCD10X addon board" bool "EVKLCD10X addon board"
depends on BOARD_ATNGW100_MKI || BOARD_ATNGW100_MKII_LCD
help help
This enables support for the EVKLCD100 (QVGA) or EVKLCD101 (VGA) This enables support for the EVKLCD100 (QVGA) or EVKLCD101 (VGA)
addon board for the NGW100. By enabling this the LCD controller and addon board for the NGW100 and NGW100 mkII. By enabling this the LCD
AC97 controller is added as platform devices. controller and AC97 controller is added as platform devices.
This choice disables the detect pin and the write-protect pin for the
MCI platform device, since it conflicts with the LCD platform device.
The MCI pins can be reenabled by editing the "add device function" but
this may break the setup for other displays that use these pins.
config BOARD_ATNGW100_MRMT config BOARD_ATNGW100_MRMT
bool "Mediama RMT1/2 add-on board" bool "Mediama RMT1/2 add-on board"
...@@ -55,4 +62,4 @@ if BOARD_ATNGW100_MRMT ...@@ -55,4 +62,4 @@ if BOARD_ATNGW100_MRMT
source "arch/avr32/boards/atngw100/Kconfig_mrmt" source "arch/avr32/boards/atngw100/Kconfig_mrmt"
endif endif
endif # BOARD_ATNGW100 endif # BOARD_ATNGW100_COMMON
...@@ -164,7 +164,12 @@ static int __init atevklcd10x_init(void) ...@@ -164,7 +164,12 @@ static int __init atevklcd10x_init(void)
at32_add_device_lcdc(0, &atevklcd10x_lcdc_data, at32_add_device_lcdc(0, &atevklcd10x_lcdc_data,
fbmem_start, fbmem_size, fbmem_start, fbmem_size,
ATMEL_LCDC_ALT_18BIT | ATMEL_LCDC_PE_DVAL); #ifdef CONFIG_BOARD_ATNGW100_MKII
ATMEL_LCDC_PRI_18BIT | ATMEL_LCDC_PC_DVAL
#else
ATMEL_LCDC_ALT_18BIT | ATMEL_LCDC_PE_DVAL
#endif
);
at32_add_device_ac97c(0, &ac97c0_data, AC97C_BOTH); at32_add_device_ac97c(0, &ac97c0_data, AC97C_BOTH);
......
...@@ -302,6 +302,7 @@ static int __init mrmt1_init(void) ...@@ -302,6 +302,7 @@ static int __init mrmt1_init(void)
at32_select_periph( GPIO_PIOB_BASE, 1 << (PB_EXTINT_BASE+TS_IRQ), at32_select_periph( GPIO_PIOB_BASE, 1 << (PB_EXTINT_BASE+TS_IRQ),
GPIO_PERIPH_A, AT32_GPIOF_DEGLITCH); GPIO_PERIPH_A, AT32_GPIOF_DEGLITCH);
set_irq_type( AT32_EXTINT(TS_IRQ), IRQ_TYPE_EDGE_FALLING ); set_irq_type( AT32_EXTINT(TS_IRQ), IRQ_TYPE_EDGE_FALLING );
at32_spi_setup_slaves(0,spi01_board_info,ARRAY_SIZE(spi01_board_info));
spi_register_board_info(spi01_board_info,ARRAY_SIZE(spi01_board_info)); spi_register_board_info(spi01_board_info,ARRAY_SIZE(spi01_board_info));
#endif #endif
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/atmel-mci.h> #include <linux/atmel-mci.h>
#include <linux/usb/atmel_usba_udc.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/setup.h> #include <asm/setup.h>
...@@ -36,6 +37,75 @@ unsigned long at32_board_osc_rates[3] = { ...@@ -36,6 +37,75 @@ unsigned long at32_board_osc_rates[3] = {
[2] = 12000000, /* 12 MHz on osc1 */ [2] = 12000000, /* 12 MHz on osc1 */
}; };
/*
* The ATNGW100 mkII is very similar to the ATNGW100. Both have the AT32AP7000
* chip on board; the difference is that the ATNGW100 mkII has 128 MB 32-bit
* SDRAM (the ATNGW100 has 32 MB 16-bit SDRAM) and 256 MB 16-bit NAND flash
* (the ATNGW100 has none.)
*
* The RAM difference is handled by the boot loader, so the only difference we
* end up handling here is the NAND flash, EBI pin reservation and if LCDC or
* MACB1 should be enabled.
*/
#ifdef CONFIG_BOARD_ATNGW100_MKII
#include <linux/mtd/partitions.h>
#include <mach/smc.h>
static struct smc_timing nand_timing __initdata = {
.ncs_read_setup = 0,
.nrd_setup = 10,
.ncs_write_setup = 0,
.nwe_setup = 10,
.ncs_read_pulse = 30,
.nrd_pulse = 15,
.ncs_write_pulse = 30,
.nwe_pulse = 15,
.read_cycle = 30,
.write_cycle = 30,
.ncs_read_recover = 0,
.nrd_recover = 15,
.ncs_write_recover = 0,
/* WE# high -> RE# low min 60 ns */
.nwe_recover = 50,
};
static struct smc_config nand_config __initdata = {
.bus_width = 2,
.nrd_controlled = 1,
.nwe_controlled = 1,
.nwait_mode = 0,
.byte_write = 0,
.tdf_cycles = 2,
.tdf_mode = 0,
};
static struct mtd_partition nand_partitions[] = {
{
.name = "main",
.offset = 0x00000000,
.size = MTDPART_SIZ_FULL,
},
};
static struct mtd_partition *nand_part_info(int size, int *num_partitions)
{
*num_partitions = ARRAY_SIZE(nand_partitions);
return nand_partitions;
}
static struct atmel_nand_data atngw100mkii_nand_data __initdata = {
.cle = 21,
.ale = 22,
.rdy_pin = GPIO_PIN_PB(28),
.enable_pin = GPIO_PIN_PE(23),
.bus_width_16 = true,
.partition_info = nand_part_info,
};
#endif
/* Initialized by bootloader-specific startup code. */ /* Initialized by bootloader-specific startup code. */
struct tag *bootloader_tags __initdata; struct tag *bootloader_tags __initdata;
...@@ -56,9 +126,9 @@ static struct spi_board_info spi0_board_info[] __initdata = { ...@@ -56,9 +126,9 @@ static struct spi_board_info spi0_board_info[] __initdata = {
static struct mci_platform_data __initdata mci0_data = { static struct mci_platform_data __initdata mci0_data = {
.slot[0] = { .slot[0] = {
.bus_width = 4, .bus_width = 4,
#if defined(CONFIG_BOARD_ATNGW100_EVKLCD10X) || defined(CONFIG_BOARD_ATNGW100_MRMT1) #if defined(CONFIG_BOARD_ATNGW100_MKII)
.detect_pin = GPIO_PIN_NONE, .detect_pin = GPIO_PIN_PC(25),
.wp_pin = GPIO_PIN_NONE, .wp_pin = GPIO_PIN_PE(22),
#else #else
.detect_pin = GPIO_PIN_PC(25), .detect_pin = GPIO_PIN_PC(25),
.wp_pin = GPIO_PIN_PE(0), .wp_pin = GPIO_PIN_PE(0),
...@@ -66,6 +136,14 @@ static struct mci_platform_data __initdata mci0_data = { ...@@ -66,6 +136,14 @@ static struct mci_platform_data __initdata mci0_data = {
}, },
}; };
static struct usba_platform_data atngw100_usba_data __initdata = {
#if defined(CONFIG_BOARD_ATNGW100_MKII)
.vbus_pin = GPIO_PIN_PE(26),
#else
.vbus_pin = -ENODEV,
#endif
};
/* /*
* The next two functions should go away as the boot loader is * The next two functions should go away as the boot loader is
* supposed to initialize the macb address registers with a valid * supposed to initialize the macb address registers with a valid
...@@ -173,18 +251,27 @@ static int __init atngw100_init(void) ...@@ -173,18 +251,27 @@ static int __init atngw100_init(void)
unsigned i; unsigned i;
/* /*
* ATNGW100 uses 16-bit SDRAM interface, so we don't need to * ATNGW100 mkII uses 32-bit SDRAM interface. Reserve the
* reserve any pins for it. * SDRAM-specific pins so that nobody messes with them.
*/ */
#ifdef CONFIG_BOARD_ATNGW100_MKII
at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL);
smc_set_timing(&nand_config, &nand_timing);
smc_set_configuration(3, &nand_config);
at32_add_device_nand(0, &atngw100mkii_nand_data);
#endif
at32_add_device_usart(0); at32_add_device_usart(0);
set_hw_addr(at32_add_device_eth(0, &eth_data[0])); set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
#ifndef CONFIG_BOARD_ATNGW100_MKII_LCD
set_hw_addr(at32_add_device_eth(1, &eth_data[1])); set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
#endif
at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
at32_add_device_mci(0, &mci0_data); at32_add_device_mci(0, &mci0_data);
at32_add_device_usba(0, NULL); at32_add_device_usba(0, &atngw100_usba_data);
for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) { for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) {
at32_select_gpio(ngw_leds[i].gpio, at32_select_gpio(ngw_leds[i].gpio,
...@@ -194,10 +281,14 @@ static int __init atngw100_init(void) ...@@ -194,10 +281,14 @@ static int __init atngw100_init(void)
/* all these i2c/smbus pins should have external pullups for /* all these i2c/smbus pins should have external pullups for
* open-drain sharing among all I2C devices. SDA and SCL do; * open-drain sharing among all I2C devices. SDA and SCL do;
* PB28/EXTINT3 doesn't; it should be SMBALERT# (for PMBus), * PB28/EXTINT3 (ATNGW100) and PE21 (ATNGW100 mkII) doesn't; it should
* but it's not available off-board. * be SMBALERT# (for PMBus), but it's not available off-board.
*/ */
#ifdef CONFIG_BOARD_ATNGW100_MKII
at32_select_periph(GPIO_PIOE_BASE, 1 << 21, 0, AT32_GPIOF_PULLUP);
#else
at32_select_periph(GPIO_PIOB_BASE, 1 << 28, 0, AT32_GPIOF_PULLUP); at32_select_periph(GPIO_PIOB_BASE, 1 << 28, 0, AT32_GPIOF_PULLUP);
#endif
at32_select_gpio(i2c_gpio_data.sda_pin, at32_select_gpio(i2c_gpio_data.sda_pin,
AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
at32_select_gpio(i2c_gpio_data.scl_pin, at32_select_gpio(i2c_gpio_data.scl_pin,
...@@ -211,14 +302,22 @@ postcore_initcall(atngw100_init); ...@@ -211,14 +302,22 @@ postcore_initcall(atngw100_init);
static int __init atngw100_arch_init(void) static int __init atngw100_arch_init(void)
{ {
/* PB30 is the otherwise unused jumper on the mainboard, with an /* PB30 (ATNGW100) and PE30 (ATNGW100 mkII) is the otherwise unused
* external pullup; the jumper grounds it. Use it however you * jumper on the mainboard, with an external pullup; the jumper grounds
* like, including letting U-Boot or Linux tweak boot sequences. * it. Use it however you like, including letting U-Boot or Linux tweak
* boot sequences.
*/ */
#ifdef CONFIG_BOARD_ATNGW100_MKII
at32_select_gpio(GPIO_PIN_PE(30), 0);
gpio_request(GPIO_PIN_PE(30), "j15");
gpio_direction_input(GPIO_PIN_PE(30));
gpio_export(GPIO_PIN_PE(30), false);
#else
at32_select_gpio(GPIO_PIN_PB(30), 0); at32_select_gpio(GPIO_PIN_PB(30), 0);
gpio_request(GPIO_PIN_PB(30), "j15"); gpio_request(GPIO_PIN_PB(30), "j15");
gpio_direction_input(GPIO_PIN_PB(30)); gpio_direction_input(GPIO_PIN_PB(30));
gpio_export(GPIO_PIN_PB(30), false); gpio_export(GPIO_PIN_PB(30), false);
#endif
/* set_irq_type() after the arch_initcall for EIC has run, and /* set_irq_type() after the arch_initcall for EIC has run, and
* before the I2C subsystem could try using this IRQ. * before the I2C subsystem could try using this IRQ.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef __ASM_AVR32_HARDIRQ_H #ifndef __ASM_AVR32_HARDIRQ_H
#define __ASM_AVR32_HARDIRQ_H #define __ASM_AVR32_HARDIRQ_H
#include <linux/threads.h>
#include <asm/irq.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <asm-generic/hardirq.h>
#include <linux/cache.h>
/* entry.S is sensitive to the offsets of these fields */
typedef struct {
unsigned int __softirq_pending;
} ____cacheline_aligned irq_cpustat_t;
void ack_bad_irq(unsigned int irq);
/* Standard mappings for irq_cpustat_t above */
#include <linux/irq_cpustat.h>
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ASM_AVR32_HARDIRQ_H */ #endif /* __ASM_AVR32_HARDIRQ_H */
...@@ -16,15 +16,6 @@ ...@@ -16,15 +16,6 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/sysdev.h> #include <linux/sysdev.h>
/*
* 'what should we do if we get a hw irq event on an illegal vector'.
* each architecture has to answer this themselves.
*/
void ack_bad_irq(unsigned int irq)
{
printk("unexpected IRQ %u\n", irq);
}
/* May be overridden by platform code */ /* May be overridden by platform code */
int __weak nmi_enable(void) int __weak nmi_enable(void)
{ {
......
...@@ -39,30 +39,10 @@ SECTIONS ...@@ -39,30 +39,10 @@ SECTIONS
__tagtable_begin = .; __tagtable_begin = .;
*(.taglist.init) *(.taglist.init)
__tagtable_end = .; __tagtable_end = .;
INIT_DATA
. = ALIGN(16);
__setup_start = .;
*(.init.setup)
__setup_end = .;
. = ALIGN(4);
__initcall_start = .;
INITCALLS
__initcall_end = .;
__con_initcall_start = .;
*(.con_initcall.init)
__con_initcall_end = .;
__security_initcall_start = .;
*(.security_initcall.init)
__security_initcall_end = .;
#ifdef CONFIG_BLK_DEV_INITRD
. = ALIGN(32);
__initramfs_start = .;
*(.init.ramfs)
__initramfs_end = .;
#endif
. = ALIGN(PAGE_SIZE);
__init_end = .;
} }
INIT_DATA_SECTION(16)
. = ALIGN(PAGE_SIZE);
__init_end = .;
.text : AT(ADDR(.text) - LOAD_OFFSET) { .text : AT(ADDR(.text) - LOAD_OFFSET) {
_evba = .; _evba = .;
...@@ -78,34 +58,16 @@ SECTIONS ...@@ -78,34 +58,16 @@ SECTIONS
_etext = .; _etext = .;
} = 0xd703d703 } = 0xd703d703
. = ALIGN(4); EXCEPTION_TABLE(4)
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
*(__ex_table)
__stop___ex_table = .;
}
RODATA RODATA
. = ALIGN(THREAD_SIZE);
.data : AT(ADDR(.data) - LOAD_OFFSET) { .data : AT(ADDR(.data) - LOAD_OFFSET) {
_data = .; _data = .;
_sdata = .; _sdata = .;
/*
* First, the init task union, aligned to an 8K boundary.
*/
*(.data.init_task)
/* Then, the page-aligned data */ INIT_TASK_DATA(THREAD_SIZE)
. = ALIGN(PAGE_SIZE); PAGE_ALIGNED_DATA(PAGE_SIZE);
*(.data.page_aligned) CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
/* Then, the cacheline aligned data */
. = ALIGN(L1_CACHE_BYTES);
*(.data.cacheline_aligned)
/* And the rest... */
*(.data.rel*) *(.data.rel*)
DATA_DATA DATA_DATA
CONSTRUCTORS CONSTRUCTORS
...@@ -113,16 +75,8 @@ SECTIONS ...@@ -113,16 +75,8 @@ SECTIONS
_edata = .; _edata = .;
} }
BSS_SECTION(0, 8, 8)
. = ALIGN(8); _end = .;
.bss : AT(ADDR(.bss) - LOAD_OFFSET) {
__bss_start = .;
*(.bss)
*(COMMON)
. = ALIGN(8);
__bss_stop = .;
_end = .;
}
DWARF_DEBUG DWARF_DEBUG
......
...@@ -1183,19 +1183,32 @@ static struct resource atmel_spi1_resource[] = { ...@@ -1183,19 +1183,32 @@ static struct resource atmel_spi1_resource[] = {
DEFINE_DEV(atmel_spi, 1); DEFINE_DEV(atmel_spi, 1);
DEV_CLK(spi_clk, atmel_spi1, pba, 1); DEV_CLK(spi_clk, atmel_spi1, pba, 1);
static void __init void __init
at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b, at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b, unsigned int n)
unsigned int n, const u8 *pins)
{ {
/*
* Manage the chipselects as GPIOs, normally using the same pins
* the SPI controller expects; but boards can use other pins.
*/
static u8 __initdata spi_pins[][4] = {
{ GPIO_PIN_PA(3), GPIO_PIN_PA(4),
GPIO_PIN_PA(5), GPIO_PIN_PA(20) },
{ GPIO_PIN_PB(2), GPIO_PIN_PB(3),
GPIO_PIN_PB(4), GPIO_PIN_PA(27) },
};
unsigned int pin, mode; unsigned int pin, mode;
/* There are only 2 SPI controllers */
if (bus_num > 1)
return;
for (; n; n--, b++) { for (; n; n--, b++) {
b->bus_num = bus_num; b->bus_num = bus_num;
if (b->chip_select >= 4) if (b->chip_select >= 4)
continue; continue;
pin = (unsigned)b->controller_data; pin = (unsigned)b->controller_data;
if (!pin) { if (!pin) {
pin = pins[b->chip_select]; pin = spi_pins[bus_num][b->chip_select];
b->controller_data = (void *)pin; b->controller_data = (void *)pin;
} }
mode = AT32_GPIOF_OUTPUT; mode = AT32_GPIOF_OUTPUT;
...@@ -1208,16 +1221,6 @@ at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b, ...@@ -1208,16 +1221,6 @@ at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b,
struct platform_device *__init struct platform_device *__init
at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n) at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n)
{ {
/*
* Manage the chipselects as GPIOs, normally using the same pins
* the SPI controller expects; but boards can use other pins.
*/
static u8 __initdata spi0_pins[] =
{ GPIO_PIN_PA(3), GPIO_PIN_PA(4),
GPIO_PIN_PA(5), GPIO_PIN_PA(20), };
static u8 __initdata spi1_pins[] =
{ GPIO_PIN_PB(2), GPIO_PIN_PB(3),
GPIO_PIN_PB(4), GPIO_PIN_PA(27), };
struct platform_device *pdev; struct platform_device *pdev;
u32 pin_mask; u32 pin_mask;
...@@ -1230,7 +1233,7 @@ at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n) ...@@ -1230,7 +1233,7 @@ at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n)
select_peripheral(PIOA, (1 << 0), PERIPH_A, AT32_GPIOF_PULLUP); select_peripheral(PIOA, (1 << 0), PERIPH_A, AT32_GPIOF_PULLUP);
select_peripheral(PIOA, pin_mask, PERIPH_A, 0); select_peripheral(PIOA, pin_mask, PERIPH_A, 0);
at32_spi_setup_slaves(0, b, n, spi0_pins); at32_spi_setup_slaves(0, b, n);
break; break;
case 1: case 1:
...@@ -1241,7 +1244,7 @@ at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n) ...@@ -1241,7 +1244,7 @@ at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n)
select_peripheral(PIOB, (1 << 0), PERIPH_B, AT32_GPIOF_PULLUP); select_peripheral(PIOB, (1 << 0), PERIPH_B, AT32_GPIOF_PULLUP);
select_peripheral(PIOB, pin_mask, PERIPH_B, 0); select_peripheral(PIOB, pin_mask, PERIPH_B, 0);
at32_spi_setup_slaves(1, b, n, spi1_pins); at32_spi_setup_slaves(1, b, n);
break; break;
default: default:
......
...@@ -49,6 +49,7 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data); ...@@ -49,6 +49,7 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data);
struct spi_board_info; struct spi_board_info;
struct platform_device * struct platform_device *
at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n); at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n);
void at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b, unsigned int n);
struct atmel_lcdfb_info; struct atmel_lcdfb_info;
struct platform_device * struct platform_device *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment