Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/hskinnemoen/avr32-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
  [AVR32] Initialize phy_mask for both macb devices
  [AVR32] Fix atomic_add_unless() and atomic_sub_unless()
  [AVR32] Correct misspelled CONFIG_BLK_DEV_INITRD variable.
  [AVR32] Fix build error in parse_tag_rdimg()
  [AVR32] Don't wire up macb0 unless SW6 is in default position
  [AVR32] Wire up SSC platform device 0 as TX on ATSTK1000 board
  [AVR32] Add Atmel SSC driver platform device to AT32AP architecture
  [AVR32] Remove optimization of unaligned word loads
  [AVR32] Make STK1000 mux settings configurable
  [AVR32] CPU frequency scaling for AT32AP
  [AVR32] Split SM device into PM, RTC, WDT and EIC
  [AVR32] faster avr32 unaligned access
  • Loading branch information
Linus Torvalds committed Jul 18, 2007
2 parents 97405fe + 587ca76 commit 5bae7ac
Show file tree
Hide file tree
Showing 15 changed files with 751 additions and 479 deletions.
25 changes: 25 additions & 0 deletions arch/avr32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ config BOARD_ATNGW100
bool "ATNGW100 Network Gateway"
endchoice

if BOARD_ATSTK1000
source "arch/avr32/boards/atstk1000/Kconfig"
endif

choice
prompt "Boot loader type"
default LOADER_U_BOOT
Expand Down Expand Up @@ -185,6 +189,27 @@ config CMDLINE

endmenu

menu "Power managment options"

menu "CPU Frequency scaling"

source "drivers/cpufreq/Kconfig"

config CPU_FREQ_AT32AP
bool "CPU frequency driver for AT32AP"
depends on CPU_FREQ && PLATFORM_AT32AP
default n
help
This enables the CPU frequency driver for AT32AP processors.

For details, take a look in <file:Documentation/cpu-freq>.

If in doubt, say N.

endmenu

endmenu

menu "Bus options"

config PCI
Expand Down
53 changes: 53 additions & 0 deletions arch/avr32/boards/atstk1000/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# STK1000 customization

if BOARD_ATSTK1002

config BOARD_ATSTK1002_CUSTOM
bool "Non-default STK-1002 jumper settings"
help
You will normally leave the jumpers on the CPU card at their
default settings. If you need to use certain peripherals,
you will need to change some of those jumpers.

if BOARD_ATSTK1002_CUSTOM

config BOARD_ATSTK1002_SW1_CUSTOM
bool "SW1: use SSC1 (not SPI0)"
help
This also prevents using the external DAC as an audio interface,
and means you can't initialize the on-board QVGA display.

config BOARD_ATSTK1002_SW2_CUSTOM
bool "SW2: use IRDA or TIMER0 (not UART-A, MMC/SD, and PS2-A)"
help
If you change this you'll want an updated boot loader putting
the console on UART-C not UART-A.

config BOARD_ATSTK1002_SW3_CUSTOM
bool "SW3: use TIMER1 (not SSC0 and GCLK)"
help
This also prevents using the external DAC as an audio interface.

config BOARD_ATSTK1002_SW4_CUSTOM
bool "SW4: use ISI/Camera (not GPIOs, SPI1, and PS2-B)"
help
To use the camera interface you'll need a custom card (on the
PCI-format connector) connect a video sensor.

config BOARD_ATSTK1002_SW5_CUSTOM
bool "SW5: use MACB1 (not LCDC)"

config BOARD_ATSTK1002_SW6_CUSTOM
bool "SW6: more GPIOs (not MACB0)"

endif # custom

config BOARD_ATSTK1002_SPI1
bool "Configure SPI1 controller"
depends on !BOARD_ATSTK1002_SW4_CUSTOM
help
All the signals for the second SPI controller are available on
GPIO lines and accessed through the J1 jumper block. Say "y"
here to configure that SPI controller.

endif # stk 1002
50 changes: 41 additions & 9 deletions arch/avr32/boards/atstk1000/atstk1002.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,27 @@

#include "atstk1000.h"

#define SW2_DEFAULT /* MMCI and UART_A available */

struct eth_addr {
u8 addr[6];
};

static struct eth_addr __initdata hw_addr[2];
static struct eth_platform_data __initdata eth_data[2];
static struct eth_platform_data __initdata eth_data[2] = {
{
/*
* The MDIO pullups on STK1000 are a bit too weak for
* the autodetection to work properly, so we have to
* mask out everything but the correct address.
*/
.phy_mask = ~(1U << 16),
},
{
.phy_mask = ~(1U << 17),
},
};

#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM
static struct spi_board_info spi0_board_info[] __initdata = {
{
/* QVGA display */
Expand All @@ -45,6 +57,13 @@ static struct spi_board_info spi0_board_info[] __initdata = {
.mode = SPI_MODE_3,
},
};
#endif

#ifdef CONFIG_BOARD_ATSTK1002_SPI1
static struct spi_board_info spi1_board_info[] __initdata = { {
/* patch in custom entries here */
} };
#endif

/*
* The next two functions should go away as the boot loader is
Expand Down Expand Up @@ -103,10 +122,10 @@ static void __init set_hw_addr(struct platform_device *pdev)

void __init setup_board(void)
{
#ifdef SW2_DEFAULT
at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
#else
#ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM
at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */
#else
at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
#endif
/* USART 2/unused: expansion connector */
at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */
Expand Down Expand Up @@ -140,18 +159,31 @@ static int __init atstk1002_init(void)

at32_add_system_devices();

#ifdef SW2_DEFAULT
at32_add_device_usart(0);
#else
#ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM
at32_add_device_usart(1);
#else
at32_add_device_usart(0);
#endif
at32_add_device_usart(2);

#ifndef CONFIG_BOARD_ATSTK1002_SW6_CUSTOM
set_hw_addr(at32_add_device_eth(0, &eth_data[0]));

#endif
#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM
at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
#endif
#ifdef CONFIG_BOARD_ATSTK1002_SPI1
at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info));
#endif
#ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM
set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
#else
at32_add_device_lcdc(0, &atstk1000_lcdc_data,
fbmem_start, fbmem_size);
#endif
#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM
at32_add_device_ssc(0, ATMEL_SSC_TX);
#endif

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/avr32/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ __tagtable(ATAG_MEM, parse_tag_mem);

static int __init parse_tag_rdimg(struct tag *tag)
{
#ifdef CONFIG_INITRD
#ifdef CONFIG_BLK_DEV_INITRD
struct tag_mem_range *mem = &tag->u.mem_range;
int ret;

Expand All @@ -323,7 +323,7 @@ static int __init parse_tag_rdimg(struct tag *tag)
return 0;
}

ret = add_reserved_region(mem->start, mem->start + mem->size - 1,
ret = add_reserved_region(mem->addr, mem->addr + mem->size - 1,
"initrd");
if (ret) {
printk(KERN_WARNING
Expand Down
1 change: 1 addition & 0 deletions arch/avr32/mach-at32ap/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
obj-y += at32ap.o clock.o intc.o extint.o pio.o hsmc.o
obj-$(CONFIG_CPU_AT32AP7000) += at32ap7000.o
obj-$(CONFIG_CPU_AT32AP7000) += time-tc.o
obj-$(CONFIG_CPU_FREQ_AT32AP) += cpufreq.o
31 changes: 0 additions & 31 deletions arch/avr32/mach-at32ap/at32ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,10 @@
#include <linux/init.h>
#include <linux/platform_device.h>

#include <asm/io.h>

#include <asm/arch/init.h>
#include <asm/arch/sm.h>

struct at32_sm system_manager;

static int __init at32_sm_init(void)
{
struct resource *regs;
struct at32_sm *sm = &system_manager;
int ret = -ENXIO;

regs = platform_get_resource(&at32_sm_device, IORESOURCE_MEM, 0);
if (!regs)
goto fail;

spin_lock_init(&sm->lock);
sm->pdev = &at32_sm_device;

ret = -ENOMEM;
sm->regs = ioremap(regs->start, regs->end - regs->start + 1);
if (!sm->regs)
goto fail;

return 0;

fail:
printk(KERN_ERR "Failed to initialize System Manager: %d\n", ret);
return ret;
}

void __init setup_platform(void)
{
at32_sm_init();
at32_clock_init();
at32_portmux_init();
}
Expand Down
Loading

0 comments on commit 5bae7ac

Please sign in to comment.