Skip to content

Commit 5bae7ac

Browse files
author
Linus Torvalds
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents 97405fe + 587ca76 commit 5bae7ac

File tree

15 files changed

+751
-479
lines changed

15 files changed

+751
-479
lines changed

arch/avr32/Kconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ config BOARD_ATNGW100
113113
bool "ATNGW100 Network Gateway"
114114
endchoice
115115

116+
if BOARD_ATSTK1000
117+
source "arch/avr32/boards/atstk1000/Kconfig"
118+
endif
119+
116120
choice
117121
prompt "Boot loader type"
118122
default LOADER_U_BOOT
@@ -185,6 +189,27 @@ config CMDLINE
185189

186190
endmenu
187191

192+
menu "Power managment options"
193+
194+
menu "CPU Frequency scaling"
195+
196+
source "drivers/cpufreq/Kconfig"
197+
198+
config CPU_FREQ_AT32AP
199+
bool "CPU frequency driver for AT32AP"
200+
depends on CPU_FREQ && PLATFORM_AT32AP
201+
default n
202+
help
203+
This enables the CPU frequency driver for AT32AP processors.
204+
205+
For details, take a look in <file:Documentation/cpu-freq>.
206+
207+
If in doubt, say N.
208+
209+
endmenu
210+
211+
endmenu
212+
188213
menu "Bus options"
189214

190215
config PCI

arch/avr32/boards/atstk1000/Kconfig

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# STK1000 customization
2+
3+
if BOARD_ATSTK1002
4+
5+
config BOARD_ATSTK1002_CUSTOM
6+
bool "Non-default STK-1002 jumper settings"
7+
help
8+
You will normally leave the jumpers on the CPU card at their
9+
default settings. If you need to use certain peripherals,
10+
you will need to change some of those jumpers.
11+
12+
if BOARD_ATSTK1002_CUSTOM
13+
14+
config BOARD_ATSTK1002_SW1_CUSTOM
15+
bool "SW1: use SSC1 (not SPI0)"
16+
help
17+
This also prevents using the external DAC as an audio interface,
18+
and means you can't initialize the on-board QVGA display.
19+
20+
config BOARD_ATSTK1002_SW2_CUSTOM
21+
bool "SW2: use IRDA or TIMER0 (not UART-A, MMC/SD, and PS2-A)"
22+
help
23+
If you change this you'll want an updated boot loader putting
24+
the console on UART-C not UART-A.
25+
26+
config BOARD_ATSTK1002_SW3_CUSTOM
27+
bool "SW3: use TIMER1 (not SSC0 and GCLK)"
28+
help
29+
This also prevents using the external DAC as an audio interface.
30+
31+
config BOARD_ATSTK1002_SW4_CUSTOM
32+
bool "SW4: use ISI/Camera (not GPIOs, SPI1, and PS2-B)"
33+
help
34+
To use the camera interface you'll need a custom card (on the
35+
PCI-format connector) connect a video sensor.
36+
37+
config BOARD_ATSTK1002_SW5_CUSTOM
38+
bool "SW5: use MACB1 (not LCDC)"
39+
40+
config BOARD_ATSTK1002_SW6_CUSTOM
41+
bool "SW6: more GPIOs (not MACB0)"
42+
43+
endif # custom
44+
45+
config BOARD_ATSTK1002_SPI1
46+
bool "Configure SPI1 controller"
47+
depends on !BOARD_ATSTK1002_SW4_CUSTOM
48+
help
49+
All the signals for the second SPI controller are available on
50+
GPIO lines and accessed through the J1 jumper block. Say "y"
51+
here to configure that SPI controller.
52+
53+
endif # stk 1002

arch/avr32/boards/atstk1000/atstk1002.c

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,27 @@
2727

2828
#include "atstk1000.h"
2929

30-
#define SW2_DEFAULT /* MMCI and UART_A available */
3130

3231
struct eth_addr {
3332
u8 addr[6];
3433
};
3534

3635
static struct eth_addr __initdata hw_addr[2];
37-
static struct eth_platform_data __initdata eth_data[2];
36+
static struct eth_platform_data __initdata eth_data[2] = {
37+
{
38+
/*
39+
* The MDIO pullups on STK1000 are a bit too weak for
40+
* the autodetection to work properly, so we have to
41+
* mask out everything but the correct address.
42+
*/
43+
.phy_mask = ~(1U << 16),
44+
},
45+
{
46+
.phy_mask = ~(1U << 17),
47+
},
48+
};
3849

50+
#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM
3951
static struct spi_board_info spi0_board_info[] __initdata = {
4052
{
4153
/* QVGA display */
@@ -45,6 +57,13 @@ static struct spi_board_info spi0_board_info[] __initdata = {
4557
.mode = SPI_MODE_3,
4658
},
4759
};
60+
#endif
61+
62+
#ifdef CONFIG_BOARD_ATSTK1002_SPI1
63+
static struct spi_board_info spi1_board_info[] __initdata = { {
64+
/* patch in custom entries here */
65+
} };
66+
#endif
4867

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

104123
void __init setup_board(void)
105124
{
106-
#ifdef SW2_DEFAULT
107-
at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
108-
#else
125+
#ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM
109126
at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */
127+
#else
128+
at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
110129
#endif
111130
/* USART 2/unused: expansion connector */
112131
at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */
@@ -140,18 +159,31 @@ static int __init atstk1002_init(void)
140159

141160
at32_add_system_devices();
142161

143-
#ifdef SW2_DEFAULT
144-
at32_add_device_usart(0);
145-
#else
162+
#ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM
146163
at32_add_device_usart(1);
164+
#else
165+
at32_add_device_usart(0);
147166
#endif
148167
at32_add_device_usart(2);
149168

169+
#ifndef CONFIG_BOARD_ATSTK1002_SW6_CUSTOM
150170
set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
151-
171+
#endif
172+
#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM
152173
at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
174+
#endif
175+
#ifdef CONFIG_BOARD_ATSTK1002_SPI1
176+
at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info));
177+
#endif
178+
#ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM
179+
set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
180+
#else
153181
at32_add_device_lcdc(0, &atstk1000_lcdc_data,
154182
fbmem_start, fbmem_size);
183+
#endif
184+
#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM
185+
at32_add_device_ssc(0, ATMEL_SSC_TX);
186+
#endif
155187

156188
return 0;
157189
}

arch/avr32/kernel/setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ __tagtable(ATAG_MEM, parse_tag_mem);
313313

314314
static int __init parse_tag_rdimg(struct tag *tag)
315315
{
316-
#ifdef CONFIG_INITRD
316+
#ifdef CONFIG_BLK_DEV_INITRD
317317
struct tag_mem_range *mem = &tag->u.mem_range;
318318
int ret;
319319

@@ -323,7 +323,7 @@ static int __init parse_tag_rdimg(struct tag *tag)
323323
return 0;
324324
}
325325

326-
ret = add_reserved_region(mem->start, mem->start + mem->size - 1,
326+
ret = add_reserved_region(mem->addr, mem->addr + mem->size - 1,
327327
"initrd");
328328
if (ret) {
329329
printk(KERN_WARNING

arch/avr32/mach-at32ap/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
obj-y += at32ap.o clock.o intc.o extint.o pio.o hsmc.o
22
obj-$(CONFIG_CPU_AT32AP7000) += at32ap7000.o
33
obj-$(CONFIG_CPU_AT32AP7000) += time-tc.o
4+
obj-$(CONFIG_CPU_FREQ_AT32AP) += cpufreq.o

arch/avr32/mach-at32ap/at32ap.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,10 @@
1111
#include <linux/init.h>
1212
#include <linux/platform_device.h>
1313

14-
#include <asm/io.h>
15-
1614
#include <asm/arch/init.h>
17-
#include <asm/arch/sm.h>
18-
19-
struct at32_sm system_manager;
20-
21-
static int __init at32_sm_init(void)
22-
{
23-
struct resource *regs;
24-
struct at32_sm *sm = &system_manager;
25-
int ret = -ENXIO;
26-
27-
regs = platform_get_resource(&at32_sm_device, IORESOURCE_MEM, 0);
28-
if (!regs)
29-
goto fail;
30-
31-
spin_lock_init(&sm->lock);
32-
sm->pdev = &at32_sm_device;
33-
34-
ret = -ENOMEM;
35-
sm->regs = ioremap(regs->start, regs->end - regs->start + 1);
36-
if (!sm->regs)
37-
goto fail;
38-
39-
return 0;
40-
41-
fail:
42-
printk(KERN_ERR "Failed to initialize System Manager: %d\n", ret);
43-
return ret;
44-
}
4515

4616
void __init setup_platform(void)
4717
{
48-
at32_sm_init();
4918
at32_clock_init();
5019
at32_portmux_init();
5120
}

0 commit comments

Comments
 (0)