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] Fix random segfault with preemption
  [AVR32] Don't use __builtin_xchg()
  [AVR32] ngw100 i2c-gpio tweaks
  [AVR32] Ignore a few irrelevant syscalls
  [AVR32] SMC configuration in clock cycles
  [AVR32] Drop support for redundant "keepinitrd" boot-time parm.
  [AVR32] Make dma_sync_*_for_cpu no-ops
  [AVR32] Remove unneeded 8K alignment of .text section
  [AVR32] Kill a few hardcoded constants in vmlinux.lds
  [AVR32] rename vmlinux.lds
  [AVR32] fix command line parsing in early_parse_fbmem
  [AVR32] checkstack support
  [AVR32] Wire up USBA device
  [AVR32] add multidrive support for pio driver
  [AVR32] /sys/kernel/debug/at32ap_clk
  [AVR32] Move AT32_PM_BASE definition into pm.h
  • Loading branch information
Linus Torvalds committed Oct 12, 2007
2 parents 1ef3e36 + a7e30b8 commit 55982fd
Show file tree
Hide file tree
Showing 21 changed files with 446 additions and 72 deletions.
5 changes: 4 additions & 1 deletion arch/avr32/boards/atngw100/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include <asm/arch/smc.h>

static struct smc_config flash_config __initdata = {
static struct smc_timing flash_timing __initdata = {
.ncs_read_setup = 0,
.nrd_setup = 40,
.ncs_write_setup = 0,
Expand All @@ -28,7 +28,9 @@ static struct smc_config flash_config __initdata = {

.read_cycle = 120,
.write_cycle = 120,
};

static struct smc_config flash_config __initdata = {
.bus_width = 2,
.nrd_controlled = 1,
.nwe_controlled = 1,
Expand Down Expand Up @@ -82,6 +84,7 @@ static int __init atngw100_flash_init(void)
{
int ret;

smc_set_timing(&flash_config, &flash_timing);
ret = smc_set_configuration(0, &flash_config);
if (ret < 0) {
printk(KERN_ERR "atngw100: failed to set NOR flash timing\n");
Expand Down
14 changes: 10 additions & 4 deletions arch/avr32/boards/atngw100/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ static struct platform_device ngw_gpio_leds = {
};

static struct i2c_gpio_platform_data i2c_gpio_data = {
.sda_pin = GPIO_PIN_PA(6),
.scl_pin = GPIO_PIN_PA(7),
.sda_pin = GPIO_PIN_PA(6),
.scl_pin = GPIO_PIN_PA(7),
.sda_is_open_drain = 1,
.scl_is_open_drain = 1,
.udelay = 2, /* close to 100 kHz */
};

static struct platform_device i2c_gpio_device = {
Expand Down Expand Up @@ -154,15 +157,18 @@ static int __init atngw100_init(void)
set_hw_addr(at32_add_device_eth(1, &eth_data[1]));

at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
at32_add_device_usba(0, NULL);

for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) {
at32_select_gpio(ngw_leds[i].gpio,
AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
}
platform_device_register(&ngw_gpio_leds);

at32_select_gpio(i2c_gpio_data.sda_pin, 0);
at32_select_gpio(i2c_gpio_data.scl_pin, 0);
at32_select_gpio(i2c_gpio_data.sda_pin,
AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
at32_select_gpio(i2c_gpio_data.scl_pin,
AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
platform_device_register(&i2c_gpio_device);

return 0;
Expand Down
1 change: 1 addition & 0 deletions arch/avr32/boards/atstk1000/atstk1002.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ static int __init atstk1002_init(void)
at32_add_device_lcdc(0, &atstk1000_lcdc_data,
fbmem_start, fbmem_size);
#endif
at32_add_device_usba(0, NULL);
#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM
at32_add_device_ssc(0, ATMEL_SSC_TX);
#endif
Expand Down
5 changes: 4 additions & 1 deletion arch/avr32/boards/atstk1000/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include <asm/arch/smc.h>

static struct smc_config flash_config __initdata = {
static struct smc_timing flash_timing __initdata = {
.ncs_read_setup = 0,
.nrd_setup = 40,
.ncs_write_setup = 0,
Expand All @@ -28,7 +28,9 @@ static struct smc_config flash_config __initdata = {

.read_cycle = 120,
.write_cycle = 120,
};

static struct smc_config flash_config __initdata = {
.bus_width = 2,
.nrd_controlled = 1,
.nwe_controlled = 1,
Expand Down Expand Up @@ -82,6 +84,7 @@ static int __init atstk1000_flash_init(void)
{
int ret;

smc_set_timing(&flash_config, &flash_timing);
ret = smc_set_configuration(0, &flash_config);
if (ret < 0) {
printk(KERN_ERR "atstk1000: failed to set NOR flash timing\n");
Expand Down
5 changes: 0 additions & 5 deletions arch/avr32/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,3 @@ obj-y += signal.o sys_avr32.o process.o time.o
obj-y += init_task.o switch_to.o cpu.o
obj-$(CONFIG_MODULES) += module.o avr32_ksyms.o
obj-$(CONFIG_KPROBES) += kprobes.o

USE_STANDARD_AS_RULE := true

%.lds: %.lds.c FORCE
$(call if_changed_dep,cpp_lds_S)
26 changes: 25 additions & 1 deletion arch/avr32/kernel/entry-avr32b.S
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,18 @@ handle_vmalloc_miss:

.section .scall.text,"ax",@progbits
system_call:
#ifdef CONFIG_PREEMPT
mask_interrupts
#endif
pushm r12 /* r12_orig */
stmts --sp, r0-lr
zero_fp

mfsr r0, SYSREG_RAR_SUP
mfsr r1, SYSREG_RSR_SUP
#ifdef CONFIG_PREEMPT
unmask_interrupts
#endif
zero_fp
stm --sp, r0-r1

/* check for syscall tracing */
Expand Down Expand Up @@ -638,6 +645,13 @@ irq_level\level:
stmts --sp,r0-lr
mfsr r8, rar_int\level
mfsr r9, rsr_int\level

#ifdef CONFIG_PREEMPT
sub r11, pc, (. - system_call)
cp.w r11, r8
breq 4f
#endif

pushm r8-r9

mov r11, sp
Expand Down Expand Up @@ -668,6 +682,16 @@ irq_level\level:
sub sp, -4 /* ignore r12_orig */
rete

#ifdef CONFIG_PREEMPT
4: mask_interrupts
mfsr r8, rsr_int\level
sbr r8, 16
mtsr rsr_int\level, r8
ldmts sp++, r0-lr
sub sp, -4 /* ignore r12_orig */
rete
#endif

2: get_thread_info r0
ld.w r1, r0[TI_flags]
bld r1, TIF_CPU_GOING_TO_SLEEP
Expand Down
2 changes: 1 addition & 1 deletion arch/avr32/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static int __init early_parse_fbmem(char *p)

fbmem_size = memparse(p, &p);
if (*p == '@') {
fbmem_start = memparse(p, &p);
fbmem_start = memparse(p + 1, &p);
ret = add_reserved_region(fbmem_start,
fbmem_start + fbmem_size - 1,
"Framebuffer");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/
#define LOAD_OFFSET 0x00000000
#include <asm-generic/vmlinux.lds.h>
#include <asm/cache.h>
#include <asm/thread_info.h>

OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
OUTPUT_ARCH(avr32)
Expand Down Expand Up @@ -58,11 +60,10 @@ SECTIONS
*(.init.ramfs)
__initramfs_end = .;
#endif
. = ALIGN(4096);
. = ALIGN(PAGE_SIZE);
__init_end = .;
}

. = ALIGN(8192);
.text : AT(ADDR(.text) - LOAD_OFFSET) {
_evba = .;
_text = .;
Expand Down Expand Up @@ -96,7 +97,7 @@ SECTIONS

RODATA

. = ALIGN(8192);
. = ALIGN(THREAD_SIZE);

.data : AT(ADDR(.data) - LOAD_OFFSET) {
_data = .;
Expand All @@ -107,7 +108,7 @@ SECTIONS
*(.data.init_task)

/* Then, the cacheline aligned data */
. = ALIGN(32);
. = ALIGN(L1_CACHE_BYTES);
*(.data.cacheline_aligned)

/* And the rest... */
Expand Down
74 changes: 68 additions & 6 deletions arch/avr32/mach-at32ap/at32ap7000.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
#include "pio.h"
#include "pm.h"

/*
* We can reduce the code size a bit by using a constant here. Since
* this file is completely chip-specific, it's safe to not use
* ioremap. Generic drivers should of course never do this.
*/
#define AT32_PM_BASE 0xfff00000

#define PBMEM(base) \
{ \
Expand Down Expand Up @@ -1167,6 +1161,72 @@ at32_add_device_ssc(unsigned int id, unsigned int flags)
return pdev;
}

/* --------------------------------------------------------------------
* USB Device Controller
* -------------------------------------------------------------------- */
static struct resource usba0_resource[] __initdata = {
{
.start = 0xff300000,
.end = 0xff3fffff,
.flags = IORESOURCE_MEM,
}, {
.start = 0xfff03000,
.end = 0xfff033ff,
.flags = IORESOURCE_MEM,
},
IRQ(31),
};
static struct clk usba0_pclk = {
.name = "pclk",
.parent = &pbb_clk,
.mode = pbb_clk_mode,
.get_rate = pbb_clk_get_rate,
.index = 12,
};
static struct clk usba0_hclk = {
.name = "hclk",
.parent = &hsb_clk,
.mode = hsb_clk_mode,
.get_rate = hsb_clk_get_rate,
.index = 6,
};

struct platform_device *__init
at32_add_device_usba(unsigned int id, struct usba_platform_data *data)
{
struct platform_device *pdev;

if (id != 0)
return NULL;

pdev = platform_device_alloc("atmel_usba_udc", 0);
if (!pdev)
return NULL;

if (platform_device_add_resources(pdev, usba0_resource,
ARRAY_SIZE(usba0_resource)))
goto out_free_pdev;

if (data) {
if (platform_device_add_data(pdev, data, sizeof(*data)))
goto out_free_pdev;

if (data->vbus_pin != GPIO_PIN_NONE)
at32_select_gpio(data->vbus_pin, 0);
}

usba0_pclk.dev = &pdev->dev;
usba0_hclk.dev = &pdev->dev;

platform_device_add(pdev);

return pdev;

out_free_pdev:
platform_device_put(pdev);
return NULL;
}

/* --------------------------------------------------------------------
* GCLK
* -------------------------------------------------------------------- */
Expand Down Expand Up @@ -1252,6 +1312,8 @@ struct clk *at32_clock_list[] = {
&ssc0_pclk,
&ssc1_pclk,
&ssc2_pclk,
&usba0_hclk,
&usba0_pclk,
&gclk0,
&gclk1,
&gclk2,
Expand Down
Loading

0 comments on commit 55982fd

Please sign in to comment.