Changeset 21617


Ignore:
Timestamp:
2010-05-29T02:09:11+02:00 (8 years ago)
Author:
lars
Message:

[xburst] core fixes

  • Mask timer irq on startup
  • Fix dma width constants
  • Do not try to ack intc irqs
Location:
trunk/target/linux/xburst/patches-2.6.34
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/xburst/patches-2.6.34/001-core.patch

    r21438 r21617  
    1 From 7efb2cae3df49ba749860a0df04933dc522da224 Mon Sep 17 00:00:00 2001 
     1From e1828438bbdd0623cf7f9c6672f2fe65b1349aa6 Mon Sep 17 00:00:00 2001 
    22From: Lars-Peter Clausen <lars@metafoo.de> 
    33Date: Sat, 24 Apr 2010 17:35:05 +0200 
     
    1919 arch/mips/include/asm/mach-jz4740/war.h      |   25 + 
    2020 arch/mips/jz4740/Kconfig                     |   29 + 
    21  arch/mips/jz4740/Makefile                    |   17 + 
     21 arch/mips/jz4740/Makefile                    |   18 + 
    2222 arch/mips/jz4740/clock-debugfs.c             |  109 +++ 
    2323 arch/mips/jz4740/clock.c                     |  935 ++++++++++++++++++++++++++ 
    2424 arch/mips/jz4740/clock.h                     |   75 ++ 
    25  arch/mips/jz4740/dma.c                       |  339 ++++++++++ 
     25 arch/mips/jz4740/dma.c                       |  336 +++++++++ 
    2626 arch/mips/jz4740/gpio.c                      |  598 ++++++++++++++++ 
    27  arch/mips/jz4740/irq.c                       |  174 +++++ 
     27 arch/mips/jz4740/irq.c                       |  170 +++++ 
    2828 arch/mips/jz4740/irq.h                       |   21 + 
    2929 arch/mips/jz4740/platform.c                  |  246 +++++++ 
     
    3434 arch/mips/jz4740/reset.h                     |    7 + 
    3535 arch/mips/jz4740/setup.c                     |   64 ++ 
    36  arch/mips/jz4740/time.c                      |  145 ++++ 
    37  arch/mips/jz4740/timer.c                     |   45 ++ 
     36 arch/mips/jz4740/time.c                      |  144 ++++ 
     37 arch/mips/jz4740/timer.c                     |   48 ++ 
    3838 arch/mips/jz4740/timer.h                     |  130 ++++ 
    3939 arch/mips/kernel/cpu-probe.c                 |   20 + 
    4040 arch/mips/mm/tlbex.c                         |    5 + 
    41  34 files changed, 4073 insertions(+), 1 deletions(-) 
     41 34 files changed, 4069 insertions(+), 1 deletions(-) 
    4242 create mode 100644 arch/mips/include/asm/mach-jz4740/base.h 
    4343 create mode 100644 arch/mips/include/asm/mach-jz4740/clock.h 
     
    233233diff --git a/arch/mips/include/asm/mach-jz4740/dma.h b/arch/mips/include/asm/mach-jz4740/dma.h 
    234234new file mode 100644 
    235 index 0000000..d31d4e0 
     235index 0000000..bb7fc1e 
    236236--- /dev/null 
    237237+++ b/arch/mips/include/asm/mach-jz4740/dma.h 
     
    273273+ 
    274274+enum jz4740_dma_width { 
    275 +       JZ4740_DMA_WIDTH_8BIT, 
    276 +       JZ4740_DMA_WIDTH_16BIT, 
    277 +       JZ4740_DMA_WIDTH_32BIT, 
     275+       JZ4740_DMA_WIDTH_32BIT  = 0, 
     276+       JZ4740_DMA_WIDTH_8BIT   = 1, 
     277+       JZ4740_DMA_WIDTH_16BIT  = 2, 
    278278+}; 
    279279+ 
     
    929929diff --git a/arch/mips/jz4740/Kconfig b/arch/mips/jz4740/Kconfig 
    930930new file mode 100644 
    931 index 0000000..5f6da09 
     931index 0000000..b959769 
    932932--- /dev/null 
    933933+++ b/arch/mips/jz4740/Kconfig 
    934934@@ -0,0 +1,29 @@ 
    935935+choice 
    936 +    prompt "Machine type" 
    937 +    depends on MACH_JZ 
    938 +    default JZ4740_QI_LB60 
     936+       prompt "Machine type" 
     937+       depends on MACH_JZ 
     938+       default JZ4740_QI_LB60 
    939939+ 
    940940+endchoice 
     
    964964diff --git a/arch/mips/jz4740/Makefile b/arch/mips/jz4740/Makefile 
    965965new file mode 100644 
    966 index 0000000..e389ddd 
     966index 0000000..398ee91 
    967967--- /dev/null 
    968968+++ b/arch/mips/jz4740/Makefile 
    969 @@ -0,0 +1,17 @@ 
     969@@ -0,0 +1,18 @@ 
    970970+# 
    971971+# Makefile for the Ingenic JZ4740. 
     
    983983+# PM support 
    984984+ 
    985 +obj-$(CONFIG_PM)         += pm.o 
    986 + 
     985+obj-$(CONFIG_PM) += pm.o 
     986+ 
     987+EXTRA_CFLAGS += -Werror -Wall 
    987988diff --git a/arch/mips/jz4740/clock-debugfs.c b/arch/mips/jz4740/clock-debugfs.c 
    988989new file mode 100644 
     
    11021103diff --git a/arch/mips/jz4740/clock.c b/arch/mips/jz4740/clock.c 
    11031104new file mode 100644 
    1104 index 0000000..3954a20 
     1105index 0000000..df0d6d3 
    11051106--- /dev/null 
    11061107+++ b/arch/mips/jz4740/clock.c 
     
    19201921+ 
    19211922+       list_for_each_entry(clk, &jz_clocks, list) { 
    1922 +           if (strcmp(clk->name, name) == 0) 
     1923+               if (strcmp(clk->name, name) == 0) 
    19231924+                       return clk; 
    19241925+       } 
     
    21242125diff --git a/arch/mips/jz4740/dma.c b/arch/mips/jz4740/dma.c 
    21252126new file mode 100644 
    2126 index 0000000..217ddc8 
     2127index 0000000..b712afc 
    21272128--- /dev/null 
    21282129+++ b/arch/mips/jz4740/dma.c 
    2129 @@ -0,0 +1,339 @@ 
     2130@@ -0,0 +1,336 @@ 
    21302131+/* 
    21312132+ *  Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de> 
     
    22762277+{ 
    22772278+       uint32_t cmd; 
    2278 +       uint32_t ctrl; 
    22792279+ 
    22802280+       switch (config->transfer_size) { 
     
    23032303+       cmd |= JZ_DMA_CMD_TRANSFER_IRQ_ENABLE; 
    23042304+ 
    2305 +       ctrl = JZ_DMA_STATUS_CTRL_NO_DESC; 
    2306 +       ctrl |= JZ_DMA_STATUS_CTRL_HALT; 
    2307 + 
    23082305+       jz4740_dma_write(JZ_REG_DMA_CMD(dma->id), cmd); 
    2309 +       jz4740_dma_write(JZ_REG_DMA_STATUS_CTRL(dma->id), ctrl); 
     2306+       jz4740_dma_write(JZ_REG_DMA_STATUS_CTRL(dma->id), 0); 
    23102307+       jz4740_dma_write(JZ_REG_DMA_REQ_TYPE(dma->id), config->request_type); 
    23112308+} 
     
    23492346+{ 
    23502347+       jz4740_dma_write_mask(JZ_REG_DMA_STATUS_CTRL(dma->id), 
    2351 +                       JZ_DMA_STATUS_CTRL_ENABLE, 
    2352 +                       JZ_DMA_STATUS_CTRL_ENABLE | JZ_DMA_STATUS_CTRL_HALT); 
     2348+                       JZ_DMA_STATUS_CTRL_NO_DESC | JZ_DMA_STATUS_CTRL_ENABLE, 
     2349+                       JZ_DMA_STATUS_CTRL_HALT | JZ_DMA_STATUS_CTRL_NO_DESC | 
     2350+                       JZ_DMA_STATUS_CTRL_ENABLE); 
    23532351+ 
    23542352+       jz4740_dma_write_mask(JZ_REG_DMA_CTRL, 
    23552353+                       JZ_DMA_CTRL_ENABLE, 
    2356 +                       JZ_DMA_CTRL_ENABLE | JZ_DMA_CTRL_HALT); 
     2354+                       JZ_DMA_CTRL_HALT | JZ_DMA_CTRL_ENABLE); 
    23572355+} 
    23582356+EXPORT_SYMBOL_GPL(jz4740_dma_enable); 
     
    24692467diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c 
    24702468new file mode 100644 
    2471 index 0000000..14d8288 
     2469index 0000000..84f4ef9 
    24722470--- /dev/null 
    24732471+++ b/arch/mips/jz4740/gpio.c 
     
    29812979+ 
    29822980+       if (ret) 
    2983 +           return ret; 
     2981+               return ret; 
    29842982+ 
    29852983+       spin_lock_init(&chip->lock); 
     
    30123010+ 
    30133011+       for (i = 0; i < ARRAY_SIZE(jz4740_gpio_chips); ++i) { 
    3014 +           jz4740_gpio_chip_init(&jz4740_gpio_chips[i], i); 
     3012+               jz4740_gpio_chip_init(&jz4740_gpio_chips[i], i); 
    30153013+       } 
    30163014+ 
     
    30733071diff --git a/arch/mips/jz4740/irq.c b/arch/mips/jz4740/irq.c 
    30743072new file mode 100644 
    3075 index 0000000..a8c76af 
     3073index 0000000..46a03ee 
    30763074--- /dev/null 
    30773075+++ b/arch/mips/jz4740/irq.c 
    3078 @@ -0,0 +1,174 @@ 
     3076@@ -0,0 +1,170 @@ 
    30793077+/* 
    30803078+ *  Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de> 
     
    31323130+} 
    31333131+ 
    3134 +static void intc_irq_ack(unsigned int irq) 
    3135 +{ 
    3136 +       writel(IRQ_BIT(irq), jz_intc_base + JZ_REG_INTC_PENDING); 
    3137 +} 
    3138 + 
    31393132+static int intc_irq_set_wake(unsigned int irq, unsigned int on) 
    31403133+{ 
     
    31503143+       .name =         "INTC", 
    31513144+       .mask =         intc_irq_mask, 
     3145+       .mask_ack =     intc_irq_mask, 
    31523146+       .unmask =       intc_irq_unmask, 
    3153 +       .ack =          intc_irq_ack, 
    31543147+       .set_wake =     intc_irq_set_wake, 
    31553148+}; 
     
    31613154+ 
    31623155+       irq_reg = readl(jz_intc_base + JZ_REG_INTC_PENDING); 
     3156+ 
    31633157+       intc_irq = ffs(irq_reg); 
    31643158+       if (intc_irq) 
     
    40154009diff --git a/arch/mips/jz4740/time.c b/arch/mips/jz4740/time.c 
    40164010new file mode 100644 
    4017 index 0000000..7721ba7 
     4011index 0000000..da8183f 
    40184012--- /dev/null 
    40194013+++ b/arch/mips/jz4740/time.c 
    4020 @@ -0,0 +1,145 @@ 
     4014@@ -0,0 +1,144 @@ 
    40214015+/* 
    40224016+ *  Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de> 
     
    40754069+       cd->event_handler(cd); 
    40764070+ 
    4077 +    return IRQ_HANDLED; 
     4071+       return IRQ_HANDLED; 
    40784072+} 
    40794073+ 
     
    41214115+       .flags          = IRQF_PERCPU | IRQF_TIMER | IRQF_DISABLED, 
    41224116+       .name           = "jz4740-timerirq", 
    4123 +       .dev_id      = &jz4740_clockevent, 
     4117+       .dev_id         = &jz4740_clockevent, 
    41244118+}; 
    41254119+ 
     
    41334127+ 
    41344128+       clk_rate = jz4740_clock_bdata.ext_rate >> 4; 
    4135 +    jz4740_jiffies_per_tick = DIV_ROUND_CLOSEST(clk_rate, HZ); 
     4129+       jz4740_jiffies_per_tick = DIV_ROUND_CLOSEST(clk_rate, HZ); 
    41364130+ 
    41374131+       clockevent_set_clock(&jz4740_clockevent, clk_rate); 
     
    41464140+ 
    41474141+       if (ret) 
    4148 +           printk(KERN_ERR "Failed to register clocksource: %d\n", ret); 
     4142+               printk(KERN_ERR "Failed to register clocksource: %d\n", ret); 
    41494143+ 
    41504144+       setup_irq(JZ4740_IRQ_TCU0, &timer_irqaction); 
     
    41564150+ 
    41574151+       jz4740_timer_set_period(TIMER_CLOCKEVENT, jz4740_jiffies_per_tick); 
    4158 +    jz4740_timer_irq_full_enable(TIMER_CLOCKEVENT); 
    4159 + 
    4160 +    jz4740_timer_irq_full_disable(TIMER_CLOCKSOURCE); 
     4152+       jz4740_timer_irq_full_enable(TIMER_CLOCKEVENT); 
     4153+ 
    41614154+       jz4740_timer_set_period(TIMER_CLOCKSOURCE, 0xffff); 
    41624155+ 
     
    41664159diff --git a/arch/mips/jz4740/timer.c b/arch/mips/jz4740/timer.c 
    41674160new file mode 100644 
    4168 index 0000000..208f14c 
     4161index 0000000..6e09cae 
    41694162--- /dev/null 
    41704163+++ b/arch/mips/jz4740/timer.c 
    4171 @@ -0,0 +1,45 @@ 
     4164@@ -0,0 +1,48 @@ 
    41724165+/* 
    41734166+ *  Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de> 
     
    42124205+               panic("Failed to ioremap timer registers"); 
    42134206+ 
    4214 +       /* Disable all timers except those used as system timers */ 
    4215 +       writel(0x100fc, jz4740_timer_base + JZ_REG_TIMER_STOP_SET); 
     4207+       /* Disable all timer clocks except for those used as system timers */ 
     4208+       writel(0x000100fc, jz4740_timer_base + JZ_REG_TIMER_STOP_SET); 
     4209+ 
     4210+       /* Timer irqs are unmasked by default, mask them */ 
     4211+       writel(0x00ff00ff, jz4740_timer_base + JZ_REG_TIMER_MASK_SET); 
    42164212+} 
    42174213diff --git a/arch/mips/jz4740/timer.h b/arch/mips/jz4740/timer.h 
  • trunk/target/linux/xburst/patches-2.6.34/005-add-qi_lb60-board-support.patch

    r21438 r21617  
    1 From 876a111075de6fcffbaa0814ee4118ac739df1a9 Mon Sep 17 00:00:00 2001 
     1From eb15b4f5046dbb1a530ec3e6134b1b68753e1f31 Mon Sep 17 00:00:00 2001 
    22From: Lars-Peter Clausen <lars@metafoo.de> 
    33Date: Sat, 24 Apr 2010 17:24:26 +0200 
     
    7171+#endif /* __ASM_JZ4740_QI_LB60_H__ */ 
    7272diff --git a/arch/mips/jz4740/Kconfig b/arch/mips/jz4740/Kconfig 
    73 index 5f6da09..3de3b99 100644 
     73index b959769..a255c1a 100644 
    7474--- a/arch/mips/jz4740/Kconfig 
    7575+++ b/arch/mips/jz4740/Kconfig 
    7676@@ -3,6 +3,10 @@ choice 
    77      depends on MACH_JZ 
    78      default JZ4740_QI_LB60 
     77        depends on MACH_JZ 
     78        default JZ4740_QI_LB60 
    7979  
    8080+config JZ4740_QI_LB60 
     
    8686 config HAVE_PWM 
    8787diff --git a/arch/mips/jz4740/Makefile b/arch/mips/jz4740/Makefile 
    88 index e389ddd..deca88e 100644 
     88index 398ee91..dd27b49 100644 
    8989--- a/arch/mips/jz4740/Makefile 
    9090+++ b/arch/mips/jz4740/Makefile 
     
    9797 # PM support 
    9898  
    99  obj-$(CONFIG_PM)         += pm.o 
     99 obj-$(CONFIG_PM) += pm.o 
    100100diff --git a/arch/mips/jz4740/board-qi_lb60.c b/arch/mips/jz4740/board-qi_lb60.c 
    101101new file mode 100644 
Note: See TracChangeset for help on using the changeset viewer.