Skip to content

Commit

Permalink
Merge branch 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/lethal/sh-2.6

* 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Ensure all PG_dcache_dirty pages are written back.
  sh: mach-ecovec24: setup.c detailed correction
  serial: sh-sci: Convert tremaining ctrl_xxx I/O routines to __raw_xxx.
  serial: sh-sci: earlyprintk zero uartclk fix
  sh: Only use bl bit toggling for sleeping idle.
  sh: Restore bl bit toggling in idle loop.
  sh: Fix up MAX_DMA_CHANNELS definition when DMA is disabled.
  sh: dmaengine support for SH7785
  sh: dmaengine support for sh7724.
  • Loading branch information
torvalds committed Dec 24, 2009
2 parents 4310471 + f34548c commit ef2c55e
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 78 deletions.
4 changes: 2 additions & 2 deletions arch/sh/boards/mach-ecovec24/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ static struct platform_device nor_flash_device = {

/* SH Eth */
#define SH_ETH_ADDR (0xA4600000)
#define SH_ETH_MAHR (SH_ETH_ADDR + 0x1C0)
#define SH_ETH_MALR (SH_ETH_ADDR + 0x1C8)
static struct resource sh_eth_resources[] = {
[0] = {
.start = SH_ETH_ADDR,
Expand Down Expand Up @@ -509,6 +507,7 @@ static struct platform_device sdhi1_device = {

#else

/* MMC SPI */
static int mmc_spi_get_ro(struct device *dev)
{
return gpio_get_value(GPIO_PTY6);
Expand Down Expand Up @@ -542,6 +541,7 @@ static struct spi_board_info spi_bus[] = {
},
};

/* MSIOF0 */
static struct sh_msiof_spi_info msiof0_data = {
.num_chipselect = 1,
};
Expand Down
6 changes: 4 additions & 2 deletions arch/sh/include/asm/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
#include <asm-generic/dma.h>

#ifdef CONFIG_NR_DMA_CHANNELS
# define MAX_DMA_CHANNELS (CONFIG_NR_DMA_CHANNELS)
# define MAX_DMA_CHANNELS (CONFIG_NR_DMA_CHANNELS)
#elif defined(CONFIG_NR_ONCHIP_DMA_CHANNELS)
# define MAX_DMA_CHANNELS (CONFIG_NR_ONCHIP_DMA_CHANNELS)
#else
# define MAX_DMA_CHANNELS (CONFIG_NR_ONCHIP_DMA_CHANNELS)
# define MAX_DMA_CHANNELS 0
#endif

/*
Expand Down
8 changes: 4 additions & 4 deletions arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#elif defined(CONFIG_CPU_SUBTYPE_SH7723) || \
defined(CONFIG_CPU_SUBTYPE_SH7724)
#define DMTE0_IRQ 48 /* DMAC0A*/
#define DMTE4_IRQ 40 /* DMAC0B */
#define DMTE6_IRQ 42
#define DMTE8_IRQ 76 /* DMAC1A */
#define DMTE9_IRQ 77
#define DMTE4_IRQ 76 /* DMAC0B */
#define DMTE6_IRQ 40
#define DMTE8_IRQ 42 /* DMAC1A */
#define DMTE9_IRQ 43
#define DMTE10_IRQ 72 /* DMAC1B */
#define DMTE11_IRQ 73
#define DMAE0_IRQ 78 /* DMA Error IRQ*/
Expand Down
15 changes: 15 additions & 0 deletions arch/sh/kernel/cpu/sh4a/setup-sh7724.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,23 @@
#include <linux/notifier.h>
#include <asm/suspend.h>
#include <asm/clock.h>
#include <asm/dma-sh.h>
#include <asm/mmzone.h>
#include <cpu/sh7724.h>

/* DMA */
static struct sh_dmae_pdata dma_platform_data = {
.mode = SHDMA_DMAOR1,
};

static struct platform_device dma_device = {
.name = "sh-dma-engine",
.id = -1,
.dev = {
.platform_data = &dma_platform_data,
},
};

/* Serial */
static struct plat_sci_port scif0_platform_data = {
.mapbase = 0xffe00000,
Expand Down Expand Up @@ -649,6 +663,7 @@ static struct platform_device *sh7724_devices[] __initdata = {
&tmu3_device,
&tmu4_device,
&tmu5_device,
&dma_device,
&rtc_device,
&iic0_device,
&iic1_device,
Expand Down
14 changes: 14 additions & 0 deletions arch/sh/kernel/cpu/sh4a/setup-sh7785.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/io.h>
#include <linux/mm.h>
#include <linux/sh_timer.h>
#include <asm/dma-sh.h>
#include <asm/mmzone.h>

static struct plat_sci_port scif0_platform_data = {
Expand Down Expand Up @@ -294,6 +295,18 @@ static struct platform_device tmu5_device = {
.num_resources = ARRAY_SIZE(tmu5_resources),
};

static struct sh_dmae_pdata dma_platform_data = {
.mode = (SHDMA_MIX_IRQ | SHDMA_DMAOR1),
};

static struct platform_device dma_device = {
.name = "sh-dma-engine",
.id = -1,
.dev = {
.platform_data = &dma_platform_data,
},
};

static struct platform_device *sh7785_devices[] __initdata = {
&scif0_device,
&scif1_device,
Expand All @@ -307,6 +320,7 @@ static struct platform_device *sh7785_devices[] __initdata = {
&tmu3_device,
&tmu4_device,
&tmu5_device,
&dma_device,
};

static int __init sh7785_devices_setup(void)
Expand Down
2 changes: 2 additions & 0 deletions arch/sh/kernel/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ void default_idle(void)
clear_thread_flag(TIF_POLLING_NRFLAG);
smp_mb__after_clear_bit();

set_bl_bit();
if (!need_resched()) {
local_irq_enable();
cpu_sleep();
} else
local_irq_enable();

set_thread_flag(TIF_POLLING_NRFLAG);
clear_bl_bit();
} else
poll_idle();
}
Expand Down
8 changes: 2 additions & 6 deletions arch/sh/mm/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,8 @@ void __update_cache(struct vm_area_struct *vma,
page = pfn_to_page(pfn);
if (pfn_valid(pfn)) {
int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
if (dirty) {
unsigned long addr = (unsigned long)page_address(page);

if (pages_do_alias(addr, address & PAGE_MASK))
__flush_purge_region((void *)addr, PAGE_SIZE);
}
if (dirty)
__flush_purge_region(page_address(page), PAGE_SIZE);
}
}

Expand Down
20 changes: 15 additions & 5 deletions drivers/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
Set SCP6MD1,0 = {01} (output) */
__raw_writew((data & 0x0fcf) | 0x1000, SCPCR);

data = ctrl_inb(SCPDR);
data = __raw_readb(SCPDR);
/* Set /RTS2 (bit6) = 0 */
ctrl_outb(data & 0xbf, SCPDR);
__raw_writeb(data & 0xbf, SCPDR);
}
}
#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
Expand Down Expand Up @@ -897,11 +897,21 @@ static void sci_shutdown(struct uart_port *port)
static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
struct ktermios *old)
{
unsigned int status, baud, smr_val;
unsigned int status, baud, smr_val, max_baud;
int t = -1;

baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
if (likely(baud))
/*
* earlyprintk comes here early on with port->uartclk set to zero.
* the clock framework is not up and running at this point so here
* we assume that 115200 is the maximum baud rate. please note that
* the baud rate is not programmed during earlyprintk - it is assumed
* that the previous boot loader has enabled required clocks and
* setup the baud rate generator hardware for us already.
*/
max_baud = port->uartclk ? port->uartclk / 16 : 115200;

baud = uart_get_baud_rate(port, termios, old, 0, max_baud);
if (likely(baud && port->uartclk))
t = SCBRR_VALUE(baud, port->uartclk);

do {
Expand Down
Loading

0 comments on commit ef2c55e

Please sign in to comment.