Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
at32ap700x.c File Reference
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dw_dmac.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/spi/spi.h>
#include <linux/usb/atmel_usba_udc.h>
#include <mach/atmel-mci.h>
#include <linux/atmel-mci.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <mach/at32ap700x.h>
#include <mach/board.h>
#include <mach/hmatrix.h>
#include <mach/portmux.h>
#include <mach/sram.h>
#include <sound/atmel-abdac.h>
#include <sound/atmel-ac97c.h>
#include <video/atmel_lcdc.h>
#include "clock.h"
#include "pio.h"
#include "pm.h"

Go to the source code of this file.

Macros

#define PBMEM(base)
 
#define IRQ(num)
 
#define NAMED_IRQ(num, _name)
 
#define DEFINE_DEV(_name, _id)
 
#define DEFINE_DEV_DATA(_name, _id)
 
#define select_peripheral(port, pin_mask, periph, flags)
 
#define DEV_CLK(_name, devname, bus, _index)
 
#define EP(nam, idx, maxpkt, maxbk, dma, isoc)
 

Functions

void pba_clk_mode (struct clk *clk, int enabled)
 
unsigned long pba_clk_get_rate (struct clk *clk)
 
int genclk_set_parent (struct clk *clk, struct clk *parent)
 
 DEFINE_DEV_DATA (dw_dmac, 0)
 
 DEV_CLK (hclk, dw_dmac0, hsb, 10)
 
 DEFINE_DEV (at32_pm, 0)
 
 DEFINE_DEV (at32ap700x_rtc, 0)
 
 DEFINE_DEV (at32_wdt, 0)
 
 DEFINE_DEV (at32_eic, 0)
 
 DEV_CLK (pclk, at32_intc0, pbb, 1)
 
 DEFINE_DEV (smc, 0)
 
 DEV_CLK (pclk, smc0, pbb, 13)
 
 DEV_CLK (mck, smc0, hsb, 0)
 
 DEV_CLK (hclk, pdc, hsb, 4)
 
 DEV_CLK (pclk, pdc, pba, 16)
 
 DEV_CLK (t0_clk, at32_tcb0, pbb, 3)
 
 DEV_CLK (t0_clk, at32_tcb1, pbb, 4)
 
 DEFINE_DEV (pio, 0)
 
 DEV_CLK (mck, pio0, pba, 10)
 
 DEFINE_DEV (pio, 1)
 
 DEV_CLK (mck, pio1, pba, 11)
 
 DEFINE_DEV (pio, 2)
 
 DEV_CLK (mck, pio2, pba, 12)
 
 DEFINE_DEV (pio, 3)
 
 DEV_CLK (mck, pio3, pba, 13)
 
 DEFINE_DEV (pio, 4)
 
 DEV_CLK (mck, pio4, pba, 14)
 
 core_initcall (system_device_init)
 
struct platform_device *__init at32_add_device_psif (unsigned int id)
 
 DEFINE_DEV_DATA (atmel_usart, 0)
 
 DEV_CLK (usart, atmel_usart0, pba, 3)
 
 DEFINE_DEV_DATA (atmel_usart, 1)
 
 DEV_CLK (usart, atmel_usart1, pba, 4)
 
 DEFINE_DEV_DATA (atmel_usart, 2)
 
 DEV_CLK (usart, atmel_usart2, pba, 5)
 
 DEFINE_DEV_DATA (atmel_usart, 3)
 
 DEV_CLK (usart, atmel_usart3, pba, 6)
 
void __init at32_map_usart (unsigned int hw_id, unsigned int line, int flags)
 
struct platform_device *__init at32_add_device_usart (unsigned int id)
 
void __init at32_setup_serial_console (unsigned int usart_id)
 
 DEFINE_DEV (atmel_spi, 0)
 
 DEV_CLK (spi_clk, atmel_spi0, pba, 0)
 
 DEFINE_DEV (atmel_spi, 1)
 
 DEV_CLK (spi_clk, atmel_spi1, pba, 1)
 
void __init at32_spi_setup_slaves (unsigned int bus_num, struct spi_board_info *b, unsigned int n)
 
struct platform_device *__init at32_add_device_spi (unsigned int id, struct spi_board_info *b, unsigned int n)
 
struct platform_device *__init at32_add_device_twi (unsigned int id, struct i2c_board_info *b, unsigned int n)
 
struct platform_device *__init at32_add_device_mci (unsigned int id, struct mci_platform_data *data)
 
struct platform_device *__init at32_add_device_pwm (u32 mask)
 
 DEFINE_DEV (ssc, 0)
 
 DEV_CLK (pclk, ssc0, pba, 7)
 
 DEFINE_DEV (ssc, 1)
 
 DEV_CLK (pclk, ssc1, pba, 8)
 
 DEFINE_DEV (ssc, 2)
 
 DEV_CLK (pclk, ssc2, pba, 9)
 
struct platform_device *__init at32_add_device_ssc (unsigned int id, unsigned int flags)
 
struct platform_device *__init at32_add_device_usba (unsigned int id, struct usba_platform_data *data)
 
struct platform_device *__init at32_add_device_nand (unsigned int id, struct atmel_nand_data *data)
 
struct platform_device *__init at32_add_device_ac97c (unsigned int id, struct ac97c_platform_data *data, unsigned int flags)
 
struct platform_device *__init at32_add_device_abdac (unsigned int id, struct atmel_abdac_pdata *data)
 
void __init setup_platform (void)
 
 core_initcall (sram_init)
 

Variables

struct platform_device at32_intc0_device
 
struct clk at32_hmatrix_clk
 
struct gen_poolsram_pool
 

Macro Definition Documentation

#define DEFINE_DEV (   _name,
  _id 
)
Value:
static u64 _name##_id##_dma_mask = DMA_BIT_MASK(32); \
static struct platform_device _name##_id##_device = { \
.name = #_name, \
.id = _id, \
.dev = { \
.dma_mask = &_name##_id##_dma_mask, \
.coherent_dma_mask = DMA_BIT_MASK(32), \
}, \
.resource = _name##_id##_resource, \
.num_resources = ARRAY_SIZE(_name##_id##_resource), \
}

Definition at line 65 of file at32ap700x.c.

#define DEFINE_DEV_DATA (   _name,
  _id 
)
Value:
static u64 _name##_id##_dma_mask = DMA_BIT_MASK(32); \
static struct platform_device _name##_id##_device = { \
.name = #_name, \
.id = _id, \
.dev = { \
.dma_mask = &_name##_id##_dma_mask, \
.platform_data = &_name##_id##_data, \
.coherent_dma_mask = DMA_BIT_MASK(32), \
}, \
.resource = _name##_id##_resource, \
.num_resources = ARRAY_SIZE(_name##_id##_resource), \
}

Definition at line 77 of file at32ap700x.c.

#define DEV_CLK (   _name,
  devname,
  bus,
  _index 
)
Value:
static struct clk devname##_##_name = { \
.name = #_name, \
.dev = &devname##_device.dev, \
.parent = &bus##_clk, \
.mode = bus##_clk_mode, \
.get_rate = bus##_clk_get_rate, \
.index = _index, \
}

Definition at line 95 of file at32ap700x.c.

#define EP (   nam,
  idx,
  maxpkt,
  maxbk,
  dma,
  isoc 
)
Value:
[idx] = { \
.name = nam, \
.index = idx, \
.fifo_size = maxpkt, \
.nr_banks = maxbk, \
.can_dma = dma, \
.can_isoc = isoc, \
}

Definition at line 1731 of file at32ap700x.c.

#define IRQ (   num)
Value:
{ \
.start = num, \
.end = num, \
.flags = IORESOURCE_IRQ, \
}

Definition at line 48 of file at32ap700x.c.

#define NAMED_IRQ (   num,
  _name 
)
Value:
{ \
.start = num, \
.end = num, \
.name = _name, \
.flags = IORESOURCE_IRQ, \
}

Definition at line 54 of file at32ap700x.c.

#define PBMEM (   base)
Value:
{ \
.start = base, \
.end = base + 0x3ff, \
.flags = IORESOURCE_MEM, \
}

Definition at line 42 of file at32ap700x.c.

#define select_peripheral (   port,
  pin_mask,
  periph,
  flags 
)
Value:
at32_select_periph(GPIO_##port##_BASE, pin_mask, \
GPIO_##periph, flags)

Definition at line 91 of file at32ap700x.c.

Function Documentation

struct platform_device* __init at32_add_device_abdac ( unsigned int  id,
struct atmel_abdac_pdata data 
)
read

Definition at line 2113 of file at32ap700x.c.

struct platform_device* __init at32_add_device_ac97c ( unsigned int  id,
struct ac97c_platform_data data,
unsigned int  flags 
)
read

Definition at line 2019 of file at32ap700x.c.

struct platform_device* __init at32_add_device_mci ( unsigned int  id,
struct mci_platform_data data 
)
read

Definition at line 1330 of file at32ap700x.c.

struct platform_device* __init at32_add_device_nand ( unsigned int  id,
struct atmel_nand_data data 
)
read

Definition at line 1967 of file at32ap700x.c.

struct platform_device* __init at32_add_device_psif ( unsigned int  id)
read

Definition at line 884 of file at32ap700x.c.

struct platform_device* __init at32_add_device_pwm ( u32  mask)
read

Definition at line 1559 of file at32ap700x.c.

struct platform_device* __init at32_add_device_spi ( unsigned int  id,
struct spi_board_info b,
unsigned int  n 
)
read

Definition at line 1227 of file at32ap700x.c.

struct platform_device* __init at32_add_device_ssc ( unsigned int  id,
unsigned int  flags 
)
read

Definition at line 1630 of file at32ap700x.c.

struct platform_device* __init at32_add_device_twi ( unsigned int  id,
struct i2c_board_info b,
unsigned int  n 
)
read

Definition at line 1279 of file at32ap700x.c.

struct platform_device* __init at32_add_device_usart ( unsigned int  id)
read

Definition at line 1055 of file at32ap700x.c.

struct platform_device* __init at32_add_device_usba ( unsigned int  id,
struct usba_platform_data data 
)
read

Definition at line 1754 of file at32ap700x.c.

void __init at32_map_usart ( unsigned int  hw_id,
unsigned int  line,
int  flags 
)

Definition at line 1017 of file at32ap700x.c.

void __init at32_setup_serial_console ( unsigned int  usart_id)

Definition at line 1061 of file at32ap700x.c.

void __init at32_spi_setup_slaves ( unsigned int  bus_num,
struct spi_board_info b,
unsigned int  n 
)

Definition at line 1192 of file at32ap700x.c.

core_initcall ( system_device_init  )
core_initcall ( sram_init  )
DEFINE_DEV ( at32_pm  ,
 
)
DEFINE_DEV ( at32ap700x_rtc  ,
 
)
DEFINE_DEV ( at32_wdt  ,
 
)
DEFINE_DEV ( at32_eic  ,
 
)
DEFINE_DEV ( smc  ,
 
)
DEFINE_DEV ( pio  ,
 
)
DEFINE_DEV ( pio  ,
 
)
DEFINE_DEV ( pio  ,
 
)
DEFINE_DEV ( pio  ,
 
)
DEFINE_DEV ( pio  ,
 
)
DEFINE_DEV ( atmel_spi  ,
 
)
DEFINE_DEV ( atmel_spi  ,
 
)
DEFINE_DEV ( ssc  ,
 
)
DEFINE_DEV ( ssc  ,
 
)
DEFINE_DEV ( ssc  ,
 
)
DEFINE_DEV_DATA ( dw_dmac  ,
 
)
DEFINE_DEV_DATA ( atmel_usart  ,
 
)
DEFINE_DEV_DATA ( atmel_usart  ,
 
)
DEFINE_DEV_DATA ( atmel_usart  ,
 
)
DEFINE_DEV_DATA ( atmel_usart  ,
 
)
DEV_CLK ( hclk  ,
dw_dmac0  ,
hsb  ,
10   
)
DEV_CLK ( pclk  ,
at32_intc0  ,
pbb  ,
 
)
DEV_CLK ( pclk  ,
smc0  ,
pbb  ,
13   
)
DEV_CLK ( mck  ,
smc0  ,
hsb  ,
 
)
DEV_CLK ( hclk  ,
pdc  ,
hsb  ,
 
)
DEV_CLK ( pclk  ,
pdc  ,
pba  ,
16   
)
DEV_CLK ( t0_clk  ,
at32_tcb0  ,
pbb  ,
 
)
DEV_CLK ( t0_clk  ,
at32_tcb1  ,
pbb  ,
 
)
DEV_CLK ( mck  ,
pio0  ,
pba  ,
10   
)
DEV_CLK ( mck  ,
pio1  ,
pba  ,
11   
)
DEV_CLK ( mck  ,
pio2  ,
pba  ,
12   
)
DEV_CLK ( mck  ,
pio3  ,
pba  ,
13   
)
DEV_CLK ( mck  ,
pio4  ,
pba  ,
14   
)
DEV_CLK ( usart  ,
atmel_usart0  ,
pba  ,
 
)
DEV_CLK ( usart  ,
atmel_usart1  ,
pba  ,
 
)
DEV_CLK ( usart  ,
atmel_usart2  ,
pba  ,
 
)
DEV_CLK ( usart  ,
atmel_usart3  ,
pba  ,
 
)
DEV_CLK ( spi_clk  ,
atmel_spi0  ,
pba  ,
 
)
DEV_CLK ( spi_clk  ,
atmel_spi1  ,
pba  ,
 
)
DEV_CLK ( pclk  ,
ssc0  ,
pba  ,
 
)
DEV_CLK ( pclk  ,
ssc1  ,
pba  ,
 
)
DEV_CLK ( pclk  ,
ssc2  ,
pba  ,
 
)
int genclk_set_parent ( struct clk clk,
struct clk parent 
)

Definition at line 563 of file at32ap700x.c.

unsigned long pba_clk_get_rate ( struct clk clk)

Definition at line 445 of file at32ap700x.c.

void pba_clk_mode ( struct clk clk,
int  enabled 
)

Definition at line 430 of file at32ap700x.c.

void __init setup_platform ( void  )

Definition at line 2267 of file at32ap700x.c.

Variable Documentation

struct clk at32_hmatrix_clk
Initial value:
= {
.name = "hmatrix_clk",
.parent = &pbb_clk,
.mode = pbb_clk_mode,
.get_rate = pbb_clk_get_rate,
.index = 2,
.users = 1,
}

Definition at line 738 of file at32ap700x.c.

struct platform_device at32_intc0_device
Initial value:
= {
.name = "intc",
.id = 0,
.resource = intc0_resource,
.num_resources = ARRAY_SIZE(intc0_resource),
}

Definition at line 680 of file at32ap700x.c.

struct gen_pool* sram_pool

Definition at line 2336 of file at32ap700x.c.