mirror of
https://github.com/AetherDroid/android_kernel_samsung_on5xelte.git
synced 2025-09-08 09:08:05 -04:00
Fixed MTP to work with TWRP
This commit is contained in:
commit
f6dfaef42e
50820 changed files with 20846062 additions and 0 deletions
117
arch/blackfin/mach-bf537/Kconfig
Normal file
117
arch/blackfin/mach-bf537/Kconfig
Normal file
|
@ -0,0 +1,117 @@
|
|||
if (BF537 || BF534 || BF536)
|
||||
|
||||
source "arch/blackfin/mach-bf537/boards/Kconfig"
|
||||
|
||||
menu "BF537 Specific Configuration"
|
||||
|
||||
comment "Interrupt Priority Assignment"
|
||||
menu "Priority"
|
||||
|
||||
config IRQ_PLL_WAKEUP
|
||||
int "IRQ_PLL_WAKEUP"
|
||||
default 7
|
||||
config IRQ_DMA_ERROR
|
||||
int "IRQ_DMA_ERROR Generic"
|
||||
default 7
|
||||
config IRQ_ERROR
|
||||
int "IRQ_ERROR: PPI CAN MAC SPORT0 SPORT1 SPI UART0 UART1"
|
||||
default 11
|
||||
config IRQ_RTC
|
||||
int "IRQ_RTC"
|
||||
default 8
|
||||
config IRQ_PPI
|
||||
int "IRQ_PPI"
|
||||
default 8
|
||||
config IRQ_SPORT0_RX
|
||||
int "IRQ_SPORT0_RX"
|
||||
default 9
|
||||
config IRQ_SPORT0_TX
|
||||
int "IRQ_SPORT0_TX"
|
||||
default 9
|
||||
config IRQ_SPORT1_RX
|
||||
int "IRQ_SPORT1_RX"
|
||||
default 9
|
||||
config IRQ_SPORT1_TX
|
||||
int "IRQ_SPORT1_TX"
|
||||
default 9
|
||||
config IRQ_TWI
|
||||
int "IRQ_TWI"
|
||||
default 10
|
||||
config IRQ_SPI
|
||||
int "IRQ_SPI"
|
||||
default 10
|
||||
config IRQ_UART0_RX
|
||||
int "IRQ_UART0_RX"
|
||||
default 10
|
||||
config IRQ_UART0_TX
|
||||
int "IRQ_UART0_TX"
|
||||
default 10
|
||||
config IRQ_UART1_RX
|
||||
int "IRQ_UART1_RX"
|
||||
default 10
|
||||
config IRQ_UART1_TX
|
||||
int "IRQ_UART1_TX"
|
||||
default 10
|
||||
config IRQ_CAN_RX
|
||||
int "IRQ_CAN_RX"
|
||||
default 11
|
||||
config IRQ_CAN_TX
|
||||
int "IRQ_CAN_TX"
|
||||
default 11
|
||||
config IRQ_MAC_RX
|
||||
int "IRQ_MAC_RX"
|
||||
default 11
|
||||
config IRQ_MAC_TX
|
||||
int "IRQ_MAC_TX"
|
||||
default 11
|
||||
config IRQ_TIMER0
|
||||
int "IRQ_TIMER0"
|
||||
default 7 if TICKSOURCE_GPTMR0
|
||||
default 8
|
||||
config IRQ_TIMER1
|
||||
int "IRQ_TIMER1"
|
||||
default 12
|
||||
config IRQ_TIMER2
|
||||
int "IRQ_TIMER2"
|
||||
default 12
|
||||
config IRQ_TIMER3
|
||||
int "IRQ_TIMER3"
|
||||
default 12
|
||||
config IRQ_TIMER4
|
||||
int "IRQ_TIMER4"
|
||||
default 12
|
||||
config IRQ_TIMER5
|
||||
int "IRQ_TIMER5"
|
||||
default 12
|
||||
config IRQ_TIMER6
|
||||
int "IRQ_TIMER6"
|
||||
default 12
|
||||
config IRQ_TIMER7
|
||||
int "IRQ_TIMER7"
|
||||
default 12
|
||||
config IRQ_PROG_INTA
|
||||
int "IRQ_PROG_INTA"
|
||||
default 12
|
||||
config IRQ_PORTG_INTB
|
||||
int "IRQ_PORTG_INTB"
|
||||
default 12
|
||||
config IRQ_MEM_DMA0
|
||||
int "IRQ_MEM_DMA0"
|
||||
default 13
|
||||
config IRQ_MEM_DMA1
|
||||
int "IRQ_MEM_DMA1"
|
||||
default 13
|
||||
config IRQ_WATCH
|
||||
int "IRQ_WATCH"
|
||||
default 13
|
||||
|
||||
help
|
||||
Enter the priority numbers between 7-13 ONLY. Others are Reserved.
|
||||
This applies to all the above. It is not recommended to assign the
|
||||
highest priority number 7 to UART or any other device.
|
||||
|
||||
endmenu
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
5
arch/blackfin/mach-bf537/Makefile
Normal file
5
arch/blackfin/mach-bf537/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
#
|
||||
# arch/blackfin/mach-bf537/Makefile
|
||||
#
|
||||
|
||||
obj-y := ints-priority.o dma.o
|
48
arch/blackfin/mach-bf537/boards/Kconfig
Normal file
48
arch/blackfin/mach-bf537/boards/Kconfig
Normal file
|
@ -0,0 +1,48 @@
|
|||
choice
|
||||
prompt "System type"
|
||||
default BFIN537_STAMP
|
||||
help
|
||||
Select your board!
|
||||
|
||||
config BFIN537_STAMP
|
||||
bool "BF537-STAMP"
|
||||
help
|
||||
BF537-STAMP board support.
|
||||
|
||||
config BFIN537_BLUETECHNIX_CM_E
|
||||
bool "Bluetechnix CM-BF537E"
|
||||
depends on (BF537)
|
||||
help
|
||||
CM-BF537E support for EVAL- and DEV-Board.
|
||||
|
||||
config BFIN537_BLUETECHNIX_CM_U
|
||||
bool "Bluetechnix CM-BF537U"
|
||||
depends on (BF537)
|
||||
help
|
||||
CM-BF537U support for EVAL- and DEV-Board.
|
||||
|
||||
config BFIN537_BLUETECHNIX_TCM
|
||||
bool "Bluetechnix TCM-BF537"
|
||||
depends on (BF537)
|
||||
help
|
||||
TCM-BF537 support for EVAL- and DEV-Board.
|
||||
|
||||
config PNAV10
|
||||
bool "PNAV board"
|
||||
depends on (BF537)
|
||||
help
|
||||
PNAV board support.
|
||||
|
||||
config CAMSIG_MINOTAUR
|
||||
bool "Cambridge Signal Processing LTD Minotaur"
|
||||
depends on (BF537)
|
||||
help
|
||||
Board supply package for CSP Minotaur
|
||||
|
||||
config DNP5370
|
||||
bool "SSV Dil/NetPC DNP/5370"
|
||||
depends on (BF537)
|
||||
help
|
||||
Board supply package for DNP/5370 DIL64 module
|
||||
|
||||
endchoice
|
11
arch/blackfin/mach-bf537/boards/Makefile
Normal file
11
arch/blackfin/mach-bf537/boards/Makefile
Normal file
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# arch/blackfin/mach-bf537/boards/Makefile
|
||||
#
|
||||
|
||||
obj-$(CONFIG_BFIN537_STAMP) += stamp.o
|
||||
obj-$(CONFIG_BFIN537_BLUETECHNIX_CM_E) += cm_bf537e.o
|
||||
obj-$(CONFIG_BFIN537_BLUETECHNIX_CM_U) += cm_bf537u.o
|
||||
obj-$(CONFIG_BFIN537_BLUETECHNIX_TCM) += tcm_bf537.o
|
||||
obj-$(CONFIG_PNAV10) += pnav10.o
|
||||
obj-$(CONFIG_CAMSIG_MINOTAUR) += minotaur.o
|
||||
obj-$(CONFIG_DNP5370) += dnp5370.o
|
945
arch/blackfin/mach-bf537/boards/cm_bf537e.c
Normal file
945
arch/blackfin/mach-bf537/boards/cm_bf537e.c
Normal file
|
@ -0,0 +1,945 @@
|
|||
/*
|
||||
* Copyright 2004-2009 Analog Devices Inc.
|
||||
* 2008-2009 Bluetechnix
|
||||
* 2005 National ICT Australia (NICTA)
|
||||
* Aidan Williams <aidan@nicta.com.au>
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/flash.h>
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
#include <linux/usb/isp1362.h>
|
||||
#endif
|
||||
#include <linux/ata_platform.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/bfin5xx_spi.h>
|
||||
#include <asm/portmux.h>
|
||||
#include <asm/dpmc.h>
|
||||
#include <asm/bfin_sport.h>
|
||||
|
||||
/*
|
||||
* Name the Board for the /proc/cpuinfo
|
||||
*/
|
||||
const char bfin_board_name[] = "Bluetechnix CM BF537E";
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
/* all SPI peripherals info goes here */
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
static struct mtd_partition bfin_spi_flash_partitions[] = {
|
||||
{
|
||||
.name = "bootloader(spi)",
|
||||
.size = 0x00020000,
|
||||
.offset = 0,
|
||||
.mask_flags = MTD_CAP_ROM
|
||||
}, {
|
||||
.name = "linux kernel(spi)",
|
||||
.size = 0xe0000,
|
||||
.offset = 0x20000
|
||||
}, {
|
||||
.name = "file system(spi)",
|
||||
.size = 0x700000,
|
||||
.offset = 0x00100000,
|
||||
}
|
||||
};
|
||||
|
||||
static struct flash_platform_data bfin_spi_flash_data = {
|
||||
.name = "m25p80",
|
||||
.parts = bfin_spi_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
|
||||
.type = "m25p64",
|
||||
};
|
||||
|
||||
/* SPI flash chip (m25p64) */
|
||||
static struct bfin5xx_spi_chip spi_flash_chip_info = {
|
||||
.enable_dma = 0, /* use dma transfer with this chip*/
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
static struct bfin5xx_spi_chip mmc_spi_chip_info = {
|
||||
.enable_dma = 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct spi_board_info bfin_spi_board_info[] __initdata = {
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
{
|
||||
/* the modalias must be the same as spi device driver name */
|
||||
.modalias = "m25p80", /* Name of spi_driver for this device */
|
||||
.max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0, /* Framework bus number */
|
||||
.chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
|
||||
.platform_data = &bfin_spi_flash_data,
|
||||
.controller_data = &spi_flash_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
|
||||
{
|
||||
.modalias = "ad183x",
|
||||
.max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 4,
|
||||
},
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
{
|
||||
.modalias = "mmc_spi",
|
||||
.max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 1,
|
||||
.controller_data = &mmc_spi_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
/* SPI (0) */
|
||||
static struct resource bfin_spi0_resource[] = {
|
||||
[0] = {
|
||||
.start = SPI0_REGBASE,
|
||||
.end = SPI0_REGBASE + 0xFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = CH_SPI,
|
||||
.end = CH_SPI,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
[2] = {
|
||||
.start = IRQ_SPI,
|
||||
.end = IRQ_SPI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
/* SPI controller data */
|
||||
static struct bfin5xx_spi_master bfin_spi0_info = {
|
||||
.num_chipselect = 8,
|
||||
.enable_dma = 1, /* master has the ability to do dma transfer */
|
||||
.pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_spi0_device = {
|
||||
.name = "bfin-spi",
|
||||
.id = 0, /* Bus number */
|
||||
.num_resources = ARRAY_SIZE(bfin_spi0_resource),
|
||||
.resource = bfin_spi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_spi0_info, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif /* spi master and devices */
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN_SPORT)
|
||||
|
||||
/* SPORT SPI controller data */
|
||||
static struct bfin5xx_spi_master bfin_sport_spi0_info = {
|
||||
.num_chipselect = MAX_BLACKFIN_GPIOS,
|
||||
.enable_dma = 0, /* master don't support DMA */
|
||||
.pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
|
||||
P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
|
||||
};
|
||||
|
||||
static struct resource bfin_sport_spi0_resource[] = {
|
||||
[0] = {
|
||||
.start = SPORT0_TCR1,
|
||||
.end = SPORT0_TCR1 + 0xFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_SPORT0_ERROR,
|
||||
.end = IRQ_SPORT0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport_spi0_device = {
|
||||
.name = "bfin-sport-spi",
|
||||
.id = 1, /* Bus number */
|
||||
.num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
|
||||
.resource = bfin_sport_spi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport_spi0_info, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
|
||||
static struct bfin5xx_spi_master bfin_sport_spi1_info = {
|
||||
.num_chipselect = MAX_BLACKFIN_GPIOS,
|
||||
.enable_dma = 0, /* master don't support DMA */
|
||||
.pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
|
||||
P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
|
||||
};
|
||||
|
||||
static struct resource bfin_sport_spi1_resource[] = {
|
||||
[0] = {
|
||||
.start = SPORT1_TCR1,
|
||||
.end = SPORT1_TCR1 + 0xFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_SPORT1_ERROR,
|
||||
.end = IRQ_SPORT1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport_spi1_device = {
|
||||
.name = "bfin-sport-spi",
|
||||
.id = 2, /* Bus number */
|
||||
.num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
|
||||
.resource = bfin_sport_spi1_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport_spi1_info, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
|
||||
#endif /* sport spi master and devices */
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
static struct platform_device rtc_device = {
|
||||
.name = "rtc-bfin",
|
||||
.id = -1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
|
||||
static struct platform_device hitachi_fb_device = {
|
||||
.name = "hitachi-tx09",
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SMC91X)
|
||||
#include <linux/smc91x.h>
|
||||
|
||||
static struct smc91x_platdata smc91x_info = {
|
||||
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
|
||||
.leda = RPC_LED_100_10,
|
||||
.ledb = RPC_LED_TX_RX,
|
||||
};
|
||||
|
||||
static struct resource smc91x_resources[] = {
|
||||
{
|
||||
.start = 0x20200300,
|
||||
.end = 0x20200300 + 16,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PF14,
|
||||
.end = IRQ_PF14,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device smc91x_device = {
|
||||
.name = "smc91x",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(smc91x_resources),
|
||||
.resource = smc91x_resources,
|
||||
.dev = {
|
||||
.platform_data = &smc91x_info,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
static struct resource isp1362_hcd_resources[] = {
|
||||
{
|
||||
.start = 0x20308000,
|
||||
.end = 0x20308000,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = 0x20308004,
|
||||
.end = 0x20308004,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PG15,
|
||||
.end = IRQ_PG15,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
|
||||
},
|
||||
};
|
||||
|
||||
static struct isp1362_platform_data isp1362_priv = {
|
||||
.sel15Kres = 1,
|
||||
.clknotstop = 0,
|
||||
.oc_enable = 0,
|
||||
.int_act_high = 0,
|
||||
.int_edge_triggered = 0,
|
||||
.remote_wakeup_connected = 0,
|
||||
.no_power_switching = 1,
|
||||
.power_switching_mode = 0,
|
||||
};
|
||||
|
||||
static struct platform_device isp1362_hcd_device = {
|
||||
.name = "isp1362-hcd",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &isp1362_priv,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(isp1362_hcd_resources),
|
||||
.resource = isp1362_hcd_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
static struct resource net2272_bfin_resources[] = {
|
||||
{
|
||||
.start = 0x20300000,
|
||||
.end = 0x20300000 + 0x100,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PG13,
|
||||
.end = IRQ_PG13,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device net2272_bfin_device = {
|
||||
.name = "net2272",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(net2272_bfin_resources),
|
||||
.resource = net2272_bfin_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
|
||||
static struct mtd_partition cm_partitions[] = {
|
||||
{
|
||||
.name = "bootloader(nor)",
|
||||
.size = 0x40000,
|
||||
.offset = 0,
|
||||
}, {
|
||||
.name = "linux kernel(nor)",
|
||||
.size = 0x100000,
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
}, {
|
||||
.name = "file system(nor)",
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
}
|
||||
};
|
||||
|
||||
static struct physmap_flash_data cm_flash_data = {
|
||||
.width = 2,
|
||||
.parts = cm_partitions,
|
||||
.nr_parts = ARRAY_SIZE(cm_partitions),
|
||||
};
|
||||
|
||||
static unsigned cm_flash_gpios[] = { GPIO_PF4 };
|
||||
|
||||
static struct resource cm_flash_resource[] = {
|
||||
{
|
||||
.name = "cfi_probe",
|
||||
.start = 0x20000000,
|
||||
.end = 0x201fffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = (unsigned long)cm_flash_gpios,
|
||||
.end = ARRAY_SIZE(cm_flash_gpios),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device cm_flash_device = {
|
||||
.name = "gpio-addr-flash",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &cm_flash_data,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(cm_flash_resource),
|
||||
.resource = cm_flash_resource,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
static struct resource bfin_uart0_resources[] = {
|
||||
{
|
||||
.start = UART0_THR,
|
||||
.end = UART0_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_TX,
|
||||
.end = IRQ_UART0_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_ERROR,
|
||||
.end = IRQ_UART0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_TX,
|
||||
.end = CH_UART0_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
#ifdef CONFIG_BFIN_UART0_CTSRTS
|
||||
{
|
||||
/*
|
||||
* Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
|
||||
*/
|
||||
.start = -1,
|
||||
.end = -1,
|
||||
.flags = IORESOURCE_IO,
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
|
||||
*/
|
||||
.start = -1,
|
||||
.end = -1,
|
||||
.flags = IORESOURCE_IO,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart0_peripherals[] = {
|
||||
P_UART0_TX, P_UART0_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart0_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart0_resources),
|
||||
.resource = bfin_uart0_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
static struct resource bfin_uart1_resources[] = {
|
||||
{
|
||||
.start = UART1_THR,
|
||||
.end = UART1_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_TX,
|
||||
.end = IRQ_UART1_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_ERROR,
|
||||
.end = IRQ_UART1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_TX,
|
||||
.end = CH_UART1_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
#ifdef CONFIG_BFIN_UART1_CTSRTS
|
||||
{
|
||||
/*
|
||||
* Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
|
||||
*/
|
||||
.start = -1,
|
||||
.end = -1,
|
||||
.flags = IORESOURCE_IO,
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
|
||||
*/
|
||||
.start = -1,
|
||||
.end = -1,
|
||||
.flags = IORESOURCE_IO,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart1_peripherals[] = {
|
||||
P_UART1_TX, P_UART1_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart1_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart1_resources),
|
||||
.resource = bfin_uart1_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
static struct resource bfin_sir0_resources[] = {
|
||||
{
|
||||
.start = 0xFFC00400,
|
||||
.end = 0xFFC004FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
static struct platform_device bfin_sir0_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir0_resources),
|
||||
.resource = bfin_sir0_resources,
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
static struct resource bfin_sir1_resources[] = {
|
||||
{
|
||||
.start = 0xFFC02000,
|
||||
.end = 0xFFC020FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
static struct platform_device bfin_sir1_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir1_resources),
|
||||
.resource = bfin_sir1_resources,
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
|
||||
|
||||
static struct resource bfin_twi0_resource[] = {
|
||||
[0] = {
|
||||
.start = TWI0_REGBASE,
|
||||
.end = TWI0_REGBASE,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_TWI,
|
||||
.end = IRQ_TWI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c_bfin_twi_device = {
|
||||
.name = "i2c-bfin-twi",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_twi0_resource),
|
||||
.resource = bfin_twi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_twi0_pins,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT) \
|
||||
|| IS_ENABLED(CONFIG_BFIN_SPORT)
|
||||
unsigned short bfin_sport0_peripherals[] = {
|
||||
P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
|
||||
P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
|
||||
};
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
static struct resource bfin_sport0_uart_resources[] = {
|
||||
{
|
||||
.start = SPORT0_TCR1,
|
||||
.end = SPORT0_MRCS3+4,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_RX,
|
||||
.end = IRQ_SPORT0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_ERROR,
|
||||
.end = IRQ_SPORT0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport0_uart_device = {
|
||||
.name = "bfin-sport-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
|
||||
.resource = bfin_sport0_uart_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
static struct resource bfin_sport1_uart_resources[] = {
|
||||
{
|
||||
.start = SPORT1_TCR1,
|
||||
.end = SPORT1_MRCS3+4,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT1_RX,
|
||||
.end = IRQ_SPORT1_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT1_ERROR,
|
||||
.end = IRQ_SPORT1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_sport1_peripherals[] = {
|
||||
P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
|
||||
P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport1_uart_device = {
|
||||
.name = "bfin-sport-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
|
||||
.resource = bfin_sport1_uart_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_BFIN_SPORT)
|
||||
static struct resource bfin_sport0_resources[] = {
|
||||
{
|
||||
.start = SPORT0_TCR1,
|
||||
.end = SPORT0_MRCS3+4,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_RX,
|
||||
.end = IRQ_SPORT0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_TX,
|
||||
.end = IRQ_SPORT0_TX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_ERROR,
|
||||
.end = IRQ_SPORT0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_SPORT0_TX,
|
||||
.end = CH_SPORT0_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_SPORT0_RX,
|
||||
.end = CH_SPORT0_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
static struct platform_device bfin_sport0_device = {
|
||||
.name = "bfin_sport_raw",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sport0_resources),
|
||||
.resource = bfin_sport0_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
#include <linux/bfin_mac.h>
|
||||
static const unsigned short bfin_mac_peripherals[] = P_MII0;
|
||||
|
||||
static struct bfin_phydev_platform_data bfin_phydev_data[] = {
|
||||
{
|
||||
.addr = 1,
|
||||
.irq = IRQ_MAC_PHYINT,
|
||||
},
|
||||
};
|
||||
|
||||
static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
|
||||
.phydev_number = 1,
|
||||
.phydev_data = bfin_phydev_data,
|
||||
.phy_mode = PHY_INTERFACE_MODE_MII,
|
||||
.mac_peripherals = bfin_mac_peripherals,
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mii_bus = {
|
||||
.name = "bfin_mii_bus",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus_data,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mac_device = {
|
||||
.name = "bfin_mac",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PATA_PLATFORM)
|
||||
#define PATA_INT IRQ_PF14
|
||||
|
||||
static struct pata_platform_info bfin_pata_platform_data = {
|
||||
.ioport_shift = 2,
|
||||
};
|
||||
|
||||
static struct resource bfin_pata_resources[] = {
|
||||
{
|
||||
.start = 0x2030C000,
|
||||
.end = 0x2030C01F,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = 0x2030D018,
|
||||
.end = 0x2030D01B,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = PATA_INT,
|
||||
.end = PATA_INT,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_pata_device = {
|
||||
.name = "pata_platform",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(bfin_pata_resources),
|
||||
.resource = bfin_pata_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_pata_platform_data,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
static const unsigned int cclk_vlev_datasheet[] =
|
||||
{
|
||||
VRPAIR(VLEV_085, 250000000),
|
||||
VRPAIR(VLEV_090, 376000000),
|
||||
VRPAIR(VLEV_095, 426000000),
|
||||
VRPAIR(VLEV_100, 426000000),
|
||||
VRPAIR(VLEV_105, 476000000),
|
||||
VRPAIR(VLEV_110, 476000000),
|
||||
VRPAIR(VLEV_115, 476000000),
|
||||
VRPAIR(VLEV_120, 500000000),
|
||||
VRPAIR(VLEV_125, 533000000),
|
||||
VRPAIR(VLEV_130, 600000000),
|
||||
};
|
||||
|
||||
static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
|
||||
.tuple_tab = cclk_vlev_datasheet,
|
||||
.tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
|
||||
.vr_settling_time = 25 /* us */,
|
||||
};
|
||||
|
||||
static struct platform_device bfin_dpmc = {
|
||||
.name = "bfin dpmc",
|
||||
.dev = {
|
||||
.platform_data = &bfin_dmpc_vreg_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *cm_bf537e_devices[] __initdata = {
|
||||
|
||||
&bfin_dpmc,
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SPORT)
|
||||
&bfin_sport0_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
|
||||
&hitachi_fb_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
&rtc_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
&bfin_sir0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
&bfin_sir1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
&i2c_bfin_twi_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
&bfin_sport0_uart_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
&bfin_sport1_uart_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
&isp1362_hcd_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SMC91X)
|
||||
&smc91x_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
&bfin_mii_bus,
|
||||
&bfin_mac_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
&net2272_bfin_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
&bfin_spi0_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN_SPORT)
|
||||
&bfin_sport_spi0_device,
|
||||
&bfin_sport_spi1_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PATA_PLATFORM)
|
||||
&bfin_pata_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
|
||||
&cm_flash_device,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __init net2272_init(void)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(GPIO_PG14, "net2272");
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Reset USB Chip, PG14 */
|
||||
gpio_direction_output(GPIO_PG14, 0);
|
||||
mdelay(2);
|
||||
gpio_set_value(GPIO_PG14, 1);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init cm_bf537e_init(void)
|
||||
{
|
||||
printk(KERN_INFO "%s(): registering device resources\n", __func__);
|
||||
platform_add_devices(cm_bf537e_devices, ARRAY_SIZE(cm_bf537e_devices));
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PATA_PLATFORM)
|
||||
irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
|
||||
#endif
|
||||
|
||||
if (net2272_init())
|
||||
pr_warning("unable to configure net2272; it probably won't work\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
arch_initcall(cm_bf537e_init);
|
||||
|
||||
static struct platform_device *cm_bf537e_early_devices[] __initdata = {
|
||||
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
&bfin_sport0_uart_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
&bfin_sport1_uart_device,
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
void __init native_machine_early_platform_add_devices(void)
|
||||
{
|
||||
printk(KERN_INFO "register early platform devices\n");
|
||||
early_platform_add_devices(cm_bf537e_early_devices,
|
||||
ARRAY_SIZE(cm_bf537e_early_devices));
|
||||
}
|
||||
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
802
arch/blackfin/mach-bf537/boards/cm_bf537u.c
Normal file
802
arch/blackfin/mach-bf537/boards/cm_bf537u.c
Normal file
|
@ -0,0 +1,802 @@
|
|||
/*
|
||||
* Copyright 2004-2009 Analog Devices Inc.
|
||||
* 2008-2009 Bluetechnix
|
||||
* 2005 National ICT Australia (NICTA)
|
||||
* Aidan Williams <aidan@nicta.com.au>
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/flash.h>
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
#include <linux/usb/isp1362.h>
|
||||
#endif
|
||||
#include <linux/ata_platform.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/bfin5xx_spi.h>
|
||||
#include <asm/portmux.h>
|
||||
#include <asm/dpmc.h>
|
||||
#include <linux/spi/mmc_spi.h>
|
||||
|
||||
/*
|
||||
* Name the Board for the /proc/cpuinfo
|
||||
*/
|
||||
const char bfin_board_name[] = "Bluetechnix CM BF537U";
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
/* all SPI peripherals info goes here */
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
static struct mtd_partition bfin_spi_flash_partitions[] = {
|
||||
{
|
||||
.name = "bootloader(spi)",
|
||||
.size = 0x00020000,
|
||||
.offset = 0,
|
||||
.mask_flags = MTD_CAP_ROM
|
||||
}, {
|
||||
.name = "linux kernel(spi)",
|
||||
.size = 0xe0000,
|
||||
.offset = 0x20000
|
||||
}, {
|
||||
.name = "file system(spi)",
|
||||
.size = 0x700000,
|
||||
.offset = 0x00100000,
|
||||
}
|
||||
};
|
||||
|
||||
static struct flash_platform_data bfin_spi_flash_data = {
|
||||
.name = "m25p80",
|
||||
.parts = bfin_spi_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
|
||||
.type = "m25p64",
|
||||
};
|
||||
|
||||
/* SPI flash chip (m25p64) */
|
||||
static struct bfin5xx_spi_chip spi_flash_chip_info = {
|
||||
.enable_dma = 0, /* use dma transfer with this chip*/
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
static struct bfin5xx_spi_chip mmc_spi_chip_info = {
|
||||
.enable_dma = 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct spi_board_info bfin_spi_board_info[] __initdata = {
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
{
|
||||
/* the modalias must be the same as spi device driver name */
|
||||
.modalias = "m25p80", /* Name of spi_driver for this device */
|
||||
.max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0, /* Framework bus number */
|
||||
.chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
|
||||
.platform_data = &bfin_spi_flash_data,
|
||||
.controller_data = &spi_flash_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
|
||||
{
|
||||
.modalias = "ad183x",
|
||||
.max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 4,
|
||||
},
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
{
|
||||
.modalias = "mmc_spi",
|
||||
.max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 1,
|
||||
.controller_data = &mmc_spi_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
/* SPI (0) */
|
||||
static struct resource bfin_spi0_resource[] = {
|
||||
[0] = {
|
||||
.start = SPI0_REGBASE,
|
||||
.end = SPI0_REGBASE + 0xFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = CH_SPI,
|
||||
.end = CH_SPI,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
[2] = {
|
||||
.start = IRQ_SPI,
|
||||
.end = IRQ_SPI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
/* SPI controller data */
|
||||
static struct bfin5xx_spi_master bfin_spi0_info = {
|
||||
.num_chipselect = 8,
|
||||
.enable_dma = 1, /* master has the ability to do dma transfer */
|
||||
.pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_spi0_device = {
|
||||
.name = "bfin-spi",
|
||||
.id = 0, /* Bus number */
|
||||
.num_resources = ARRAY_SIZE(bfin_spi0_resource),
|
||||
.resource = bfin_spi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_spi0_info, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif /* spi master and devices */
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
static struct platform_device rtc_device = {
|
||||
.name = "rtc-bfin",
|
||||
.id = -1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
|
||||
static struct platform_device hitachi_fb_device = {
|
||||
.name = "hitachi-tx09",
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SMC91X)
|
||||
#include <linux/smc91x.h>
|
||||
|
||||
static struct smc91x_platdata smc91x_info = {
|
||||
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
|
||||
.leda = RPC_LED_100_10,
|
||||
.ledb = RPC_LED_TX_RX,
|
||||
};
|
||||
|
||||
static struct resource smc91x_resources[] = {
|
||||
{
|
||||
.start = 0x20200300,
|
||||
.end = 0x20200300 + 16,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PF14,
|
||||
.end = IRQ_PF14,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device smc91x_device = {
|
||||
.name = "smc91x",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(smc91x_resources),
|
||||
.resource = smc91x_resources,
|
||||
.dev = {
|
||||
.platform_data = &smc91x_info,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
static struct resource isp1362_hcd_resources[] = {
|
||||
{
|
||||
.start = 0x20308000,
|
||||
.end = 0x20308000,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = 0x20308004,
|
||||
.end = 0x20308004,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PG15,
|
||||
.end = IRQ_PG15,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
|
||||
},
|
||||
};
|
||||
|
||||
static struct isp1362_platform_data isp1362_priv = {
|
||||
.sel15Kres = 1,
|
||||
.clknotstop = 0,
|
||||
.oc_enable = 0,
|
||||
.int_act_high = 0,
|
||||
.int_edge_triggered = 0,
|
||||
.remote_wakeup_connected = 0,
|
||||
.no_power_switching = 1,
|
||||
.power_switching_mode = 0,
|
||||
};
|
||||
|
||||
static struct platform_device isp1362_hcd_device = {
|
||||
.name = "isp1362-hcd",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &isp1362_priv,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(isp1362_hcd_resources),
|
||||
.resource = isp1362_hcd_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
static struct resource net2272_bfin_resources[] = {
|
||||
{
|
||||
.start = 0x20200000,
|
||||
.end = 0x20200000 + 0x100,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PH14,
|
||||
.end = IRQ_PH14,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device net2272_bfin_device = {
|
||||
.name = "net2272",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(net2272_bfin_resources),
|
||||
.resource = net2272_bfin_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
|
||||
static struct mtd_partition cm_partitions[] = {
|
||||
{
|
||||
.name = "bootloader(nor)",
|
||||
.size = 0x40000,
|
||||
.offset = 0,
|
||||
}, {
|
||||
.name = "linux kernel(nor)",
|
||||
.size = 0x100000,
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
}, {
|
||||
.name = "file system(nor)",
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
}
|
||||
};
|
||||
|
||||
static struct physmap_flash_data cm_flash_data = {
|
||||
.width = 2,
|
||||
.parts = cm_partitions,
|
||||
.nr_parts = ARRAY_SIZE(cm_partitions),
|
||||
};
|
||||
|
||||
static unsigned cm_flash_gpios[] = { GPIO_PH0 };
|
||||
|
||||
static struct resource cm_flash_resource[] = {
|
||||
{
|
||||
.name = "cfi_probe",
|
||||
.start = 0x20000000,
|
||||
.end = 0x201fffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = (unsigned long)cm_flash_gpios,
|
||||
.end = ARRAY_SIZE(cm_flash_gpios),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device cm_flash_device = {
|
||||
.name = "gpio-addr-flash",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &cm_flash_data,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(cm_flash_resource),
|
||||
.resource = cm_flash_resource,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
static struct resource bfin_uart0_resources[] = {
|
||||
{
|
||||
.start = UART0_THR,
|
||||
.end = UART0_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_TX,
|
||||
.end = IRQ_UART0_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_ERROR,
|
||||
.end = IRQ_UART0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_TX,
|
||||
.end = CH_UART0_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart0_peripherals[] = {
|
||||
P_UART0_TX, P_UART0_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart0_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart0_resources),
|
||||
.resource = bfin_uart0_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
static struct resource bfin_uart1_resources[] = {
|
||||
{
|
||||
.start = UART1_THR,
|
||||
.end = UART1_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_TX,
|
||||
.end = IRQ_UART1_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_ERROR,
|
||||
.end = IRQ_UART1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_TX,
|
||||
.end = CH_UART1_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart1_peripherals[] = {
|
||||
P_UART1_TX, P_UART1_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart1_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart1_resources),
|
||||
.resource = bfin_uart1_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
static struct resource bfin_sir0_resources[] = {
|
||||
{
|
||||
.start = 0xFFC00400,
|
||||
.end = 0xFFC004FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
static struct platform_device bfin_sir0_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir0_resources),
|
||||
.resource = bfin_sir0_resources,
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
static struct resource bfin_sir1_resources[] = {
|
||||
{
|
||||
.start = 0xFFC02000,
|
||||
.end = 0xFFC020FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
static struct platform_device bfin_sir1_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir1_resources),
|
||||
.resource = bfin_sir1_resources,
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
|
||||
|
||||
static struct resource bfin_twi0_resource[] = {
|
||||
[0] = {
|
||||
.start = TWI0_REGBASE,
|
||||
.end = TWI0_REGBASE,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_TWI,
|
||||
.end = IRQ_TWI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c_bfin_twi_device = {
|
||||
.name = "i2c-bfin-twi",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_twi0_resource),
|
||||
.resource = bfin_twi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_twi0_pins,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
static struct resource bfin_sport0_uart_resources[] = {
|
||||
{
|
||||
.start = SPORT0_TCR1,
|
||||
.end = SPORT0_MRCS3+4,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_RX,
|
||||
.end = IRQ_SPORT0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_ERROR,
|
||||
.end = IRQ_SPORT0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_sport0_peripherals[] = {
|
||||
P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
|
||||
P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport0_uart_device = {
|
||||
.name = "bfin-sport-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
|
||||
.resource = bfin_sport0_uart_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
static struct resource bfin_sport1_uart_resources[] = {
|
||||
{
|
||||
.start = SPORT1_TCR1,
|
||||
.end = SPORT1_MRCS3+4,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT1_RX,
|
||||
.end = IRQ_SPORT1_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT1_ERROR,
|
||||
.end = IRQ_SPORT1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_sport1_peripherals[] = {
|
||||
P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
|
||||
P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport1_uart_device = {
|
||||
.name = "bfin-sport-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
|
||||
.resource = bfin_sport1_uart_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
#include <linux/bfin_mac.h>
|
||||
static const unsigned short bfin_mac_peripherals[] = P_MII0;
|
||||
|
||||
static struct bfin_phydev_platform_data bfin_phydev_data[] = {
|
||||
{
|
||||
.addr = 1,
|
||||
.irq = IRQ_MAC_PHYINT,
|
||||
},
|
||||
};
|
||||
|
||||
static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
|
||||
.phydev_number = 1,
|
||||
.phydev_data = bfin_phydev_data,
|
||||
.phy_mode = PHY_INTERFACE_MODE_MII,
|
||||
.mac_peripherals = bfin_mac_peripherals,
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mii_bus = {
|
||||
.name = "bfin_mii_bus",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus_data,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mac_device = {
|
||||
.name = "bfin_mac",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PATA_PLATFORM)
|
||||
#define PATA_INT IRQ_PF14
|
||||
|
||||
static struct pata_platform_info bfin_pata_platform_data = {
|
||||
.ioport_shift = 2,
|
||||
};
|
||||
|
||||
static struct resource bfin_pata_resources[] = {
|
||||
{
|
||||
.start = 0x2030C000,
|
||||
.end = 0x2030C01F,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = 0x2030D018,
|
||||
.end = 0x2030D01B,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = PATA_INT,
|
||||
.end = PATA_INT,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_pata_device = {
|
||||
.name = "pata_platform",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(bfin_pata_resources),
|
||||
.resource = bfin_pata_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_pata_platform_data,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
static const unsigned int cclk_vlev_datasheet[] =
|
||||
{
|
||||
VRPAIR(VLEV_085, 250000000),
|
||||
VRPAIR(VLEV_090, 376000000),
|
||||
VRPAIR(VLEV_095, 426000000),
|
||||
VRPAIR(VLEV_100, 426000000),
|
||||
VRPAIR(VLEV_105, 476000000),
|
||||
VRPAIR(VLEV_110, 476000000),
|
||||
VRPAIR(VLEV_115, 476000000),
|
||||
VRPAIR(VLEV_120, 500000000),
|
||||
VRPAIR(VLEV_125, 533000000),
|
||||
VRPAIR(VLEV_130, 600000000),
|
||||
};
|
||||
|
||||
static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
|
||||
.tuple_tab = cclk_vlev_datasheet,
|
||||
.tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
|
||||
.vr_settling_time = 25 /* us */,
|
||||
};
|
||||
|
||||
static struct platform_device bfin_dpmc = {
|
||||
.name = "bfin dpmc",
|
||||
.dev = {
|
||||
.platform_data = &bfin_dmpc_vreg_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *cm_bf537u_devices[] __initdata = {
|
||||
|
||||
&bfin_dpmc,
|
||||
|
||||
#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
|
||||
&hitachi_fb_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
&rtc_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
&bfin_sir0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
&bfin_sir1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
&i2c_bfin_twi_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
&bfin_sport0_uart_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
&bfin_sport1_uart_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
&isp1362_hcd_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SMC91X)
|
||||
&smc91x_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
&bfin_mii_bus,
|
||||
&bfin_mac_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
&net2272_bfin_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
&bfin_spi0_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PATA_PLATFORM)
|
||||
&bfin_pata_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
|
||||
&cm_flash_device,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __init net2272_init(void)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(GPIO_PH15, driver_name);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = gpio_request(GPIO_PH13, "net2272");
|
||||
if (ret) {
|
||||
gpio_free(GPIO_PH15);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Set PH15 Low make /AMS2 work properly */
|
||||
gpio_direction_output(GPIO_PH15, 0);
|
||||
|
||||
/* enable CLKBUF output */
|
||||
bfin_write_VR_CTL(bfin_read_VR_CTL() | CLKBUFOE);
|
||||
|
||||
/* Reset the USB chip */
|
||||
gpio_direction_output(GPIO_PH13, 0);
|
||||
mdelay(2);
|
||||
gpio_set_value(GPIO_PH13, 1);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init cm_bf537u_init(void)
|
||||
{
|
||||
printk(KERN_INFO "%s(): registering device resources\n", __func__);
|
||||
platform_add_devices(cm_bf537u_devices, ARRAY_SIZE(cm_bf537u_devices));
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PATA_PLATFORM)
|
||||
irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
|
||||
#endif
|
||||
|
||||
if (net2272_init())
|
||||
pr_warning("unable to configure net2272; it probably won't work\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
arch_initcall(cm_bf537u_init);
|
||||
|
||||
static struct platform_device *cm_bf537u_early_devices[] __initdata = {
|
||||
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
&bfin_sport0_uart_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
&bfin_sport1_uart_device,
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
void __init native_machine_early_platform_add_devices(void)
|
||||
{
|
||||
printk(KERN_INFO "register early platform devices\n");
|
||||
early_platform_add_devices(cm_bf537u_early_devices,
|
||||
ARRAY_SIZE(cm_bf537u_early_devices));
|
||||
}
|
||||
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
413
arch/blackfin/mach-bf537/boards/dnp5370.c
Normal file
413
arch/blackfin/mach-bf537/boards/dnp5370.c
Normal file
|
@ -0,0 +1,413 @@
|
|||
/*
|
||||
* This is the configuration for SSV Dil/NetPC DNP/5370 board.
|
||||
*
|
||||
* DIL module: http://www.dilnetpc.com/dnp0086.htm
|
||||
* SK28 (starter kit): http://www.dilnetpc.com/dnp0088.htm
|
||||
*
|
||||
* Copyright 2010 3ality Digital Systems
|
||||
* Copyright 2005 National ICT Australia (NICTA)
|
||||
* Copyright 2004-2006 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/nand.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/plat-ram.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/flash.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/spi/mmc_spi.h>
|
||||
#include <linux/phy.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/bfin5xx_spi.h>
|
||||
#include <asm/reboot.h>
|
||||
#include <asm/portmux.h>
|
||||
#include <asm/dpmc.h>
|
||||
|
||||
/*
|
||||
* Name the Board for the /proc/cpuinfo
|
||||
*/
|
||||
const char bfin_board_name[] = "DNP/5370";
|
||||
#define FLASH_MAC 0x202f0000
|
||||
#define CONFIG_MTD_PHYSMAP_LEN 0x300000
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
static struct platform_device rtc_device = {
|
||||
.name = "rtc-bfin",
|
||||
.id = -1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
#include <linux/bfin_mac.h>
|
||||
static const unsigned short bfin_mac_peripherals[] = P_RMII0;
|
||||
|
||||
static struct bfin_phydev_platform_data bfin_phydev_data[] = {
|
||||
{
|
||||
.addr = 1,
|
||||
.irq = PHY_POLL, /* IRQ_MAC_PHYINT */
|
||||
},
|
||||
};
|
||||
|
||||
static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
|
||||
.phydev_number = 1,
|
||||
.phydev_data = bfin_phydev_data,
|
||||
.phy_mode = PHY_INTERFACE_MODE_RMII,
|
||||
.mac_peripherals = bfin_mac_peripherals,
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mii_bus = {
|
||||
.name = "bfin_mii_bus",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus_data,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mac_device = {
|
||||
.name = "bfin_mac",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
|
||||
static struct mtd_partition asmb_flash_partitions[] = {
|
||||
{
|
||||
.name = "bootloader(nor)",
|
||||
.size = 0x30000,
|
||||
.offset = 0,
|
||||
}, {
|
||||
.name = "linux kernel and rootfs(nor)",
|
||||
.size = 0x300000 - 0x30000 - 0x10000,
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
}, {
|
||||
.name = "MAC address(nor)",
|
||||
.size = 0x10000,
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.mask_flags = MTD_WRITEABLE,
|
||||
}
|
||||
};
|
||||
|
||||
static struct physmap_flash_data asmb_flash_data = {
|
||||
.width = 1,
|
||||
.parts = asmb_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(asmb_flash_partitions),
|
||||
};
|
||||
|
||||
static struct resource asmb_flash_resource = {
|
||||
.start = 0x20000000,
|
||||
.end = 0x202fffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
};
|
||||
|
||||
/* 4 MB NOR flash attached to async memory banks 0-2,
|
||||
* therefore only 3 MB visible.
|
||||
*/
|
||||
static struct platform_device asmb_flash_device = {
|
||||
.name = "physmap-flash",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &asmb_flash_data,
|
||||
},
|
||||
.num_resources = 1,
|
||||
.resource = &asmb_flash_resource,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
|
||||
static struct bfin5xx_spi_chip mmc_spi_chip_info = {
|
||||
.enable_dma = 0, /* use no dma transfer with this chip*/
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_DATAFLASH)
|
||||
/* This mapping is for at45db642 it has 1056 page size,
|
||||
* partition size and offset should be page aligned
|
||||
*/
|
||||
static struct mtd_partition bfin_spi_dataflash_partitions[] = {
|
||||
{
|
||||
.name = "JFFS2 dataflash(nor)",
|
||||
#ifdef CONFIG_MTD_PAGESIZE_1024
|
||||
.offset = 0x40000,
|
||||
.size = 0x7C0000,
|
||||
#else
|
||||
.offset = 0x0,
|
||||
.size = 0x840000,
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
static struct flash_platform_data bfin_spi_dataflash_data = {
|
||||
.name = "mtd_dataflash",
|
||||
.parts = bfin_spi_dataflash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
|
||||
.type = "mtd_dataflash",
|
||||
};
|
||||
|
||||
static struct bfin5xx_spi_chip spi_dataflash_chip_info = {
|
||||
.enable_dma = 0, /* use no dma transfer with this chip*/
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct spi_board_info bfin_spi_board_info[] __initdata = {
|
||||
/* SD/MMC card reader at SPI bus */
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
{
|
||||
.modalias = "mmc_spi",
|
||||
.max_speed_hz = 20000000,
|
||||
.bus_num = 0,
|
||||
.chip_select = 1,
|
||||
.controller_data = &mmc_spi_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
|
||||
/* 8 Megabyte Atmel NOR flash chip at SPI bus */
|
||||
#if IS_ENABLED(CONFIG_MTD_DATAFLASH)
|
||||
{
|
||||
.modalias = "mtd_dataflash",
|
||||
.max_speed_hz = 16700000,
|
||||
.bus_num = 0,
|
||||
.chip_select = 2,
|
||||
.platform_data = &bfin_spi_dataflash_data,
|
||||
.controller_data = &spi_dataflash_chip_info,
|
||||
.mode = SPI_MODE_3, /* SPI_CPHA and SPI_CPOL */
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
/* SPI controller data */
|
||||
/* SPI (0) */
|
||||
static struct resource bfin_spi0_resource[] = {
|
||||
[0] = {
|
||||
.start = SPI0_REGBASE,
|
||||
.end = SPI0_REGBASE + 0xFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = CH_SPI,
|
||||
.end = CH_SPI,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
[2] = {
|
||||
.start = IRQ_SPI,
|
||||
.end = IRQ_SPI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct bfin5xx_spi_master spi_bfin_master_info = {
|
||||
.num_chipselect = 8,
|
||||
.enable_dma = 1, /* master has the ability to do dma transfer */
|
||||
.pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
|
||||
};
|
||||
|
||||
static struct platform_device spi_bfin_master_device = {
|
||||
.name = "bfin-spi",
|
||||
.id = 0, /* Bus number */
|
||||
.num_resources = ARRAY_SIZE(bfin_spi0_resource),
|
||||
.resource = bfin_spi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &spi_bfin_master_info, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
static struct resource bfin_uart0_resources[] = {
|
||||
{
|
||||
.start = UART0_THR,
|
||||
.end = UART0_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_TX,
|
||||
.end = IRQ_UART0_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_ERROR,
|
||||
.end = IRQ_UART0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_TX,
|
||||
.end = CH_UART0_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart0_peripherals[] = {
|
||||
P_UART0_TX, P_UART0_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart0_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart0_resources),
|
||||
.resource = bfin_uart0_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
static struct resource bfin_uart1_resources[] = {
|
||||
{
|
||||
.start = UART1_THR,
|
||||
.end = UART1_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_TX,
|
||||
.end = IRQ_UART1_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_ERROR,
|
||||
.end = IRQ_UART1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_TX,
|
||||
.end = CH_UART1_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart1_peripherals[] = {
|
||||
P_UART1_TX, P_UART1_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart1_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart1_resources),
|
||||
.resource = bfin_uart1_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
|
||||
|
||||
static struct resource bfin_twi0_resource[] = {
|
||||
[0] = {
|
||||
.start = TWI0_REGBASE,
|
||||
.end = TWI0_REGBASE + 0xff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_TWI,
|
||||
.end = IRQ_TWI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c_bfin_twi_device = {
|
||||
.name = "i2c-bfin-twi",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_twi0_resource),
|
||||
.resource = bfin_twi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_twi0_pins,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct platform_device *dnp5370_devices[] __initdata = {
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
|
||||
&asmb_flash_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
&bfin_mii_bus,
|
||||
&bfin_mac_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
&spi_bfin_master_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
&i2c_bfin_twi_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
&rtc_device,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
static int __init dnp5370_init(void)
|
||||
{
|
||||
printk(KERN_INFO "DNP/5370: registering device resources\n");
|
||||
platform_add_devices(dnp5370_devices, ARRAY_SIZE(dnp5370_devices));
|
||||
printk(KERN_INFO "DNP/5370: registering %zu SPI slave devices\n",
|
||||
ARRAY_SIZE(bfin_spi_board_info));
|
||||
spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
|
||||
printk(KERN_INFO "DNP/5370: MAC %pM\n", (void *)FLASH_MAC);
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(dnp5370_init);
|
||||
|
||||
/*
|
||||
* Currently the MAC address is saved in Flash by U-Boot
|
||||
*/
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
*(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
|
||||
*(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
585
arch/blackfin/mach-bf537/boards/minotaur.c
Normal file
585
arch/blackfin/mach-bf537/boards/minotaur.c
Normal file
|
@ -0,0 +1,585 @@
|
|||
/*
|
||||
* Copyright 2004-2009 Analog Devices Inc.
|
||||
* 2008-2009 Cambridge Signal Processing
|
||||
* 2005 National ICT Australia (NICTA)
|
||||
* Aidan Williams <aidan@nicta.com.au>
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/flash.h>
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
#include <linux/usb/isp1362.h>
|
||||
#endif
|
||||
#include <linux/ata_platform.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/usb/sl811.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/bfin5xx_spi.h>
|
||||
#include <asm/reboot.h>
|
||||
#include <asm/portmux.h>
|
||||
#include <linux/spi/ad7877.h>
|
||||
|
||||
/*
|
||||
* Name the Board for the /proc/cpuinfo
|
||||
*/
|
||||
const char bfin_board_name[] = "CamSig Minotaur BF537";
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
|
||||
static struct resource bfin_pcmcia_cf_resources[] = {
|
||||
{
|
||||
.start = 0x20310000, /* IO PORT */
|
||||
.end = 0x20312000,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = 0x20311000, /* Attribute Memory */
|
||||
.end = 0x20311FFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PF4,
|
||||
.end = IRQ_PF4,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
|
||||
}, {
|
||||
.start = IRQ_PF6, /* Card Detect PF6 */
|
||||
.end = IRQ_PF6,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_pcmcia_cf_device = {
|
||||
.name = "bfin_cf_pcmcia",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
|
||||
.resource = bfin_pcmcia_cf_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
static struct platform_device rtc_device = {
|
||||
.name = "rtc-bfin",
|
||||
.id = -1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
#include <linux/bfin_mac.h>
|
||||
static const unsigned short bfin_mac_peripherals[] = P_MII0;
|
||||
|
||||
static struct bfin_phydev_platform_data bfin_phydev_data[] = {
|
||||
{
|
||||
.addr = 1,
|
||||
.irq = IRQ_MAC_PHYINT,
|
||||
},
|
||||
};
|
||||
|
||||
static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
|
||||
.phydev_number = 1,
|
||||
.phydev_data = bfin_phydev_data,
|
||||
.phy_mode = PHY_INTERFACE_MODE_MII,
|
||||
.mac_peripherals = bfin_mac_peripherals,
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mii_bus = {
|
||||
.name = "bfin_mii_bus",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus_data,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mac_device = {
|
||||
.name = "bfin_mac",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
static struct resource net2272_bfin_resources[] = {
|
||||
{
|
||||
.start = 0x20300000,
|
||||
.end = 0x20300000 + 0x100,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PF7,
|
||||
.end = IRQ_PF7,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device net2272_bfin_device = {
|
||||
.name = "net2272",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(net2272_bfin_resources),
|
||||
.resource = net2272_bfin_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
/* all SPI peripherals info goes here */
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
|
||||
/* Partition sizes */
|
||||
#define FLASH_SIZE 0x00400000
|
||||
#define PSIZE_UBOOT 0x00030000
|
||||
#define PSIZE_INITRAMFS 0x00240000
|
||||
|
||||
static struct mtd_partition bfin_spi_flash_partitions[] = {
|
||||
{
|
||||
.name = "bootloader(spi)",
|
||||
.size = PSIZE_UBOOT,
|
||||
.offset = 0x000000,
|
||||
.mask_flags = MTD_CAP_ROM
|
||||
}, {
|
||||
.name = "initramfs(spi)",
|
||||
.size = PSIZE_INITRAMFS,
|
||||
.offset = PSIZE_UBOOT
|
||||
}, {
|
||||
.name = "opt(spi)",
|
||||
.size = FLASH_SIZE - (PSIZE_UBOOT + PSIZE_INITRAMFS),
|
||||
.offset = PSIZE_UBOOT + PSIZE_INITRAMFS,
|
||||
}
|
||||
};
|
||||
|
||||
static struct flash_platform_data bfin_spi_flash_data = {
|
||||
.name = "m25p80",
|
||||
.parts = bfin_spi_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
|
||||
.type = "m25p64",
|
||||
};
|
||||
|
||||
/* SPI flash chip (m25p64) */
|
||||
static struct bfin5xx_spi_chip spi_flash_chip_info = {
|
||||
.enable_dma = 0, /* use dma transfer with this chip*/
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
static struct bfin5xx_spi_chip mmc_spi_chip_info = {
|
||||
.enable_dma = 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct spi_board_info bfin_spi_board_info[] __initdata = {
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
{
|
||||
/* the modalias must be the same as spi device driver name */
|
||||
.modalias = "m25p80", /* Name of spi_driver for this device */
|
||||
.max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0, /* Framework bus number */
|
||||
.chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
|
||||
.platform_data = &bfin_spi_flash_data,
|
||||
.controller_data = &spi_flash_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
{
|
||||
.modalias = "mmc_spi",
|
||||
.max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 5,
|
||||
.controller_data = &mmc_spi_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
/* SPI controller data */
|
||||
static struct bfin5xx_spi_master bfin_spi0_info = {
|
||||
.num_chipselect = 8,
|
||||
.enable_dma = 1, /* master has the ability to do dma transfer */
|
||||
};
|
||||
|
||||
/* SPI (0) */
|
||||
static struct resource bfin_spi0_resource[] = {
|
||||
[0] = {
|
||||
.start = SPI0_REGBASE,
|
||||
.end = SPI0_REGBASE + 0xFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = CH_SPI,
|
||||
.end = CH_SPI,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
[2] = {
|
||||
.start = IRQ_SPI,
|
||||
.end = IRQ_SPI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_spi0_device = {
|
||||
.name = "bfin-spi",
|
||||
.id = 0, /* Bus number */
|
||||
.num_resources = ARRAY_SIZE(bfin_spi0_resource),
|
||||
.resource = bfin_spi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_spi0_info, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif /* spi master and devices */
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
static struct resource bfin_uart0_resources[] = {
|
||||
{
|
||||
.start = UART0_THR,
|
||||
.end = UART0_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_TX,
|
||||
.end = IRQ_UART0_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_ERROR,
|
||||
.end = IRQ_UART0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_TX,
|
||||
.end = CH_UART0_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart0_peripherals[] = {
|
||||
P_UART0_TX, P_UART0_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart0_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart0_resources),
|
||||
.resource = bfin_uart0_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
static struct resource bfin_uart1_resources[] = {
|
||||
{
|
||||
.start = UART1_THR,
|
||||
.end = UART1_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_TX,
|
||||
.end = IRQ_UART1_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_ERROR,
|
||||
.end = IRQ_UART1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_TX,
|
||||
.end = CH_UART1_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart1_peripherals[] = {
|
||||
P_UART1_TX, P_UART1_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart1_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart1_resources),
|
||||
.resource = bfin_uart1_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
static struct resource bfin_sir0_resources[] = {
|
||||
{
|
||||
.start = 0xFFC00400,
|
||||
.end = 0xFFC004FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sir0_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir0_resources),
|
||||
.resource = bfin_sir0_resources,
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
static struct resource bfin_sir1_resources[] = {
|
||||
{
|
||||
.start = 0xFFC02000,
|
||||
.end = 0xFFC020FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sir1_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir1_resources),
|
||||
.resource = bfin_sir1_resources,
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
|
||||
|
||||
static struct resource bfin_twi0_resource[] = {
|
||||
[0] = {
|
||||
.start = TWI0_REGBASE,
|
||||
.end = TWI0_REGBASE + 0xFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_TWI,
|
||||
.end = IRQ_TWI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c_bfin_twi_device = {
|
||||
.name = "i2c-bfin-twi",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_twi0_resource),
|
||||
.resource = bfin_twi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_twi0_pins,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
static struct resource bfin_sport0_uart_resources[] = {
|
||||
{
|
||||
.start = SPORT0_TCR1,
|
||||
.end = SPORT0_MRCS3+4,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_RX,
|
||||
.end = IRQ_SPORT0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_ERROR,
|
||||
.end = IRQ_SPORT0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_sport0_peripherals[] = {
|
||||
P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
|
||||
P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport0_uart_device = {
|
||||
.name = "bfin-sport-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
|
||||
.resource = bfin_sport0_uart_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
static struct resource bfin_sport1_uart_resources[] = {
|
||||
{
|
||||
.start = SPORT1_TCR1,
|
||||
.end = SPORT1_MRCS3+4,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT1_RX,
|
||||
.end = IRQ_SPORT1_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT1_ERROR,
|
||||
.end = IRQ_SPORT1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_sport1_peripherals[] = {
|
||||
P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
|
||||
P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport1_uart_device = {
|
||||
.name = "bfin-sport-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
|
||||
.resource = bfin_sport1_uart_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static struct platform_device *minotaur_devices[] __initdata = {
|
||||
#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
|
||||
&bfin_pcmcia_cf_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
&rtc_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
&bfin_mii_bus,
|
||||
&bfin_mac_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
&net2272_bfin_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
&bfin_spi0_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
&bfin_sir0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
&bfin_sir1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
&i2c_bfin_twi_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
&bfin_sport0_uart_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
&bfin_sport1_uart_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
static int __init minotaur_init(void)
|
||||
{
|
||||
printk(KERN_INFO "%s(): registering device resources\n", __func__);
|
||||
platform_add_devices(minotaur_devices, ARRAY_SIZE(minotaur_devices));
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
spi_register_board_info(bfin_spi_board_info,
|
||||
ARRAY_SIZE(bfin_spi_board_info));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
arch_initcall(minotaur_init);
|
||||
|
||||
static struct platform_device *minotaur_early_devices[] __initdata = {
|
||||
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
&bfin_sport0_uart_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
&bfin_sport1_uart_device,
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
void __init native_machine_early_platform_add_devices(void)
|
||||
{
|
||||
printk(KERN_INFO "register early platform devices\n");
|
||||
early_platform_add_devices(minotaur_early_devices,
|
||||
ARRAY_SIZE(minotaur_early_devices));
|
||||
}
|
||||
|
||||
void native_machine_restart(char *cmd)
|
||||
{
|
||||
/* workaround reboot hang when booting from SPI */
|
||||
if ((bfin_read_SYSCR() & 0x7) == 0x3)
|
||||
bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
|
||||
}
|
538
arch/blackfin/mach-bf537/boards/pnav10.c
Normal file
538
arch/blackfin/mach-bf537/boards/pnav10.c
Normal file
|
@ -0,0 +1,538 @@
|
|||
/*
|
||||
* Copyright 2004-2009 Analog Devices Inc.
|
||||
* 2005 National ICT Australia (NICTA)
|
||||
* Aidan Williams <aidan@nicta.com.au>
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/flash.h>
|
||||
#include <linux/irq.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/bfin5xx_spi.h>
|
||||
#include <asm/portmux.h>
|
||||
|
||||
#include <linux/spi/ad7877.h>
|
||||
|
||||
/*
|
||||
* Name the Board for the /proc/cpuinfo
|
||||
*/
|
||||
const char bfin_board_name[] = "ADI PNAV-1.0";
|
||||
|
||||
/*
|
||||
* Driver needs to know address, irq and flag pin.
|
||||
*/
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
|
||||
static struct resource bfin_pcmcia_cf_resources[] = {
|
||||
{
|
||||
.start = 0x20310000, /* IO PORT */
|
||||
.end = 0x20312000,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = 0x20311000, /* Attribute Memory */
|
||||
.end = 0x20311FFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PF4,
|
||||
.end = IRQ_PF4,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
|
||||
}, {
|
||||
.start = 6, /* Card Detect PF6 */
|
||||
.end = 6,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_pcmcia_cf_device = {
|
||||
.name = "bfin_cf_pcmcia",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
|
||||
.resource = bfin_pcmcia_cf_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
static struct platform_device rtc_device = {
|
||||
.name = "rtc-bfin",
|
||||
.id = -1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SMC91X)
|
||||
#include <linux/smc91x.h>
|
||||
|
||||
static struct smc91x_platdata smc91x_info = {
|
||||
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
|
||||
.leda = RPC_LED_100_10,
|
||||
.ledb = RPC_LED_TX_RX,
|
||||
};
|
||||
|
||||
static struct resource smc91x_resources[] = {
|
||||
{
|
||||
.name = "smc91x-regs",
|
||||
.start = 0x20300300,
|
||||
.end = 0x20300300 + 16,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
|
||||
.start = IRQ_PF7,
|
||||
.end = IRQ_PF7,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
static struct platform_device smc91x_device = {
|
||||
.name = "smc91x",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(smc91x_resources),
|
||||
.resource = smc91x_resources,
|
||||
.dev = {
|
||||
.platform_data = &smc91x_info,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
#include <linux/bfin_mac.h>
|
||||
static const unsigned short bfin_mac_peripherals[] = P_RMII0;
|
||||
|
||||
static struct bfin_phydev_platform_data bfin_phydev_data[] = {
|
||||
{
|
||||
.addr = 1,
|
||||
.irq = IRQ_MAC_PHYINT,
|
||||
},
|
||||
};
|
||||
|
||||
static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
|
||||
.phydev_number = 1,
|
||||
.phydev_data = bfin_phydev_data,
|
||||
.phy_mode = PHY_INTERFACE_MODE_RMII,
|
||||
.mac_peripherals = bfin_mac_peripherals,
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mii_bus = {
|
||||
.name = "bfin_mii_bus",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus_data,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mac_device = {
|
||||
.name = "bfin_mac",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
static struct resource net2272_bfin_resources[] = {
|
||||
{
|
||||
.start = 0x20300000,
|
||||
.end = 0x20300000 + 0x100,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PF7,
|
||||
.end = IRQ_PF7,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device net2272_bfin_device = {
|
||||
.name = "net2272",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(net2272_bfin_resources),
|
||||
.resource = net2272_bfin_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
/* all SPI peripherals info goes here */
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
static struct mtd_partition bfin_spi_flash_partitions[] = {
|
||||
{
|
||||
.name = "bootloader(spi)",
|
||||
.size = 0x00020000,
|
||||
.offset = 0,
|
||||
.mask_flags = MTD_CAP_ROM
|
||||
}, {
|
||||
.name = "linux kernel(spi)",
|
||||
.size = 0xe0000,
|
||||
.offset = 0x20000
|
||||
}, {
|
||||
.name = "file system(spi)",
|
||||
.size = 0x700000,
|
||||
.offset = 0x00100000,
|
||||
}
|
||||
};
|
||||
|
||||
static struct flash_platform_data bfin_spi_flash_data = {
|
||||
.name = "m25p80",
|
||||
.parts = bfin_spi_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
|
||||
.type = "m25p64",
|
||||
};
|
||||
|
||||
/* SPI flash chip (m25p64) */
|
||||
static struct bfin5xx_spi_chip spi_flash_chip_info = {
|
||||
.enable_dma = 0, /* use dma transfer with this chip*/
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
static struct bfin5xx_spi_chip mmc_spi_chip_info = {
|
||||
.enable_dma = 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
|
||||
static const struct ad7877_platform_data bfin_ad7877_ts_info = {
|
||||
.model = 7877,
|
||||
.vref_delay_usecs = 50, /* internal, no capacitor */
|
||||
.x_plate_ohms = 419,
|
||||
.y_plate_ohms = 486,
|
||||
.pressure_max = 1000,
|
||||
.pressure_min = 0,
|
||||
.stopacq_polarity = 1,
|
||||
.first_conversion_delay = 3,
|
||||
.acquisition_time = 1,
|
||||
.averaging = 1,
|
||||
.pen_down_acc_interval = 1,
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct spi_board_info bfin_spi_board_info[] __initdata = {
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
{
|
||||
/* the modalias must be the same as spi device driver name */
|
||||
.modalias = "m25p80", /* Name of spi_driver for this device */
|
||||
.max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0, /* Framework bus number */
|
||||
.chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
|
||||
.platform_data = &bfin_spi_flash_data,
|
||||
.controller_data = &spi_flash_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
|
||||
{
|
||||
.modalias = "ad183x",
|
||||
.max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 4,
|
||||
},
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
{
|
||||
.modalias = "mmc_spi",
|
||||
.max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 5,
|
||||
.controller_data = &mmc_spi_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
|
||||
{
|
||||
.modalias = "ad7877",
|
||||
.platform_data = &bfin_ad7877_ts_info,
|
||||
.irq = IRQ_PF2,
|
||||
.max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 5,
|
||||
},
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
/* SPI (0) */
|
||||
static struct resource bfin_spi0_resource[] = {
|
||||
[0] = {
|
||||
.start = SPI0_REGBASE,
|
||||
.end = SPI0_REGBASE + 0xFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = CH_SPI,
|
||||
.end = CH_SPI,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
[2] = {
|
||||
.start = IRQ_SPI,
|
||||
.end = IRQ_SPI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
/* SPI controller data */
|
||||
static struct bfin5xx_spi_master bfin_spi0_info = {
|
||||
.num_chipselect = 8,
|
||||
.enable_dma = 1, /* master has the ability to do dma transfer */
|
||||
.pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_spi0_device = {
|
||||
.name = "bfin-spi",
|
||||
.id = 0, /* Bus number */
|
||||
.num_resources = ARRAY_SIZE(bfin_spi0_resource),
|
||||
.resource = bfin_spi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_spi0_info, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif /* spi master and devices */
|
||||
|
||||
#if IS_ENABLED(CONFIG_FB_BF537_LQ035)
|
||||
static struct platform_device bfin_fb_device = {
|
||||
.name = "bf537-lq035",
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
static struct resource bfin_uart0_resources[] = {
|
||||
{
|
||||
.start = UART0_THR,
|
||||
.end = UART0_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_TX,
|
||||
.end = IRQ_UART0_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_ERROR,
|
||||
.end = IRQ_UART0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_TX,
|
||||
.end = CH_UART0_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart0_peripherals[] = {
|
||||
P_UART0_TX, P_UART0_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart0_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart0_resources),
|
||||
.resource = bfin_uart0_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
static struct resource bfin_uart1_resources[] = {
|
||||
{
|
||||
.start = UART1_THR,
|
||||
.end = UART1_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_TX,
|
||||
.end = IRQ_UART1_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_ERROR,
|
||||
.end = IRQ_UART1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_TX,
|
||||
.end = CH_UART1_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart1_peripherals[] = {
|
||||
P_UART1_TX, P_UART1_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart1_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart1_resources),
|
||||
.resource = bfin_uart1_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
static struct resource bfin_sir0_resources[] = {
|
||||
{
|
||||
.start = 0xFFC00400,
|
||||
.end = 0xFFC004FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sir0_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir0_resources),
|
||||
.resource = bfin_sir0_resources,
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
static struct resource bfin_sir1_resources[] = {
|
||||
{
|
||||
.start = 0xFFC02000,
|
||||
.end = 0xFFC020FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sir1_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir1_resources),
|
||||
.resource = bfin_sir1_resources,
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static struct platform_device *stamp_devices[] __initdata = {
|
||||
#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
|
||||
&bfin_pcmcia_cf_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
&rtc_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SMC91X)
|
||||
&smc91x_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
&bfin_mii_bus,
|
||||
&bfin_mac_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
&net2272_bfin_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
&bfin_spi0_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_FB_BF537_LQ035)
|
||||
&bfin_fb_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
&bfin_sir0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
&bfin_sir1_device,
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __init pnav_init(void)
|
||||
{
|
||||
printk(KERN_INFO "%s(): registering device resources\n", __func__);
|
||||
platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
spi_register_board_info(bfin_spi_board_info,
|
||||
ARRAY_SIZE(bfin_spi_board_info));
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
arch_initcall(pnav_init);
|
||||
|
||||
static struct platform_device *stamp_early_devices[] __initdata = {
|
||||
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
void __init native_machine_early_platform_add_devices(void)
|
||||
{
|
||||
printk(KERN_INFO "register early platform devices\n");
|
||||
early_platform_add_devices(stamp_early_devices,
|
||||
ARRAY_SIZE(stamp_early_devices));
|
||||
}
|
||||
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
3019
arch/blackfin/mach-bf537/boards/stamp.c
Normal file
3019
arch/blackfin/mach-bf537/boards/stamp.c
Normal file
File diff suppressed because it is too large
Load diff
792
arch/blackfin/mach-bf537/boards/tcm_bf537.c
Normal file
792
arch/blackfin/mach-bf537/boards/tcm_bf537.c
Normal file
|
@ -0,0 +1,792 @@
|
|||
/*
|
||||
* Copyright 2004-2009 Analog Devices Inc.
|
||||
* 2008-2009 Bluetechnix
|
||||
* 2005 National ICT Australia (NICTA)
|
||||
* Aidan Williams <aidan@nicta.com.au>
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/flash.h>
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
#include <linux/usb/isp1362.h>
|
||||
#endif
|
||||
#include <linux/ata_platform.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/bfin5xx_spi.h>
|
||||
#include <asm/portmux.h>
|
||||
#include <asm/dpmc.h>
|
||||
#include <linux/spi/mmc_spi.h>
|
||||
|
||||
/*
|
||||
* Name the Board for the /proc/cpuinfo
|
||||
*/
|
||||
const char bfin_board_name[] = "Bluetechnix TCM BF537";
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
/* all SPI peripherals info goes here */
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
static struct mtd_partition bfin_spi_flash_partitions[] = {
|
||||
{
|
||||
.name = "bootloader(spi)",
|
||||
.size = 0x00020000,
|
||||
.offset = 0,
|
||||
.mask_flags = MTD_CAP_ROM
|
||||
}, {
|
||||
.name = "linux kernel(spi)",
|
||||
.size = 0xe0000,
|
||||
.offset = 0x20000
|
||||
}, {
|
||||
.name = "file system(spi)",
|
||||
.size = 0x700000,
|
||||
.offset = 0x00100000,
|
||||
}
|
||||
};
|
||||
|
||||
static struct flash_platform_data bfin_spi_flash_data = {
|
||||
.name = "m25p80",
|
||||
.parts = bfin_spi_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
|
||||
.type = "m25p64",
|
||||
};
|
||||
|
||||
/* SPI flash chip (m25p64) */
|
||||
static struct bfin5xx_spi_chip spi_flash_chip_info = {
|
||||
.enable_dma = 0, /* use dma transfer with this chip*/
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
static struct bfin5xx_spi_chip mmc_spi_chip_info = {
|
||||
.enable_dma = 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
static struct spi_board_info bfin_spi_board_info[] __initdata = {
|
||||
#if IS_ENABLED(CONFIG_MTD_M25P80)
|
||||
{
|
||||
/* the modalias must be the same as spi device driver name */
|
||||
.modalias = "m25p80", /* Name of spi_driver for this device */
|
||||
.max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0, /* Framework bus number */
|
||||
.chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
|
||||
.platform_data = &bfin_spi_flash_data,
|
||||
.controller_data = &spi_flash_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
|
||||
{
|
||||
.modalias = "ad183x",
|
||||
.max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 4,
|
||||
},
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_SPI)
|
||||
{
|
||||
.modalias = "mmc_spi",
|
||||
.max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
|
||||
.bus_num = 0,
|
||||
.chip_select = 1,
|
||||
.controller_data = &mmc_spi_chip_info,
|
||||
.mode = SPI_MODE_3,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
/* SPI (0) */
|
||||
static struct resource bfin_spi0_resource[] = {
|
||||
[0] = {
|
||||
.start = SPI0_REGBASE,
|
||||
.end = SPI0_REGBASE + 0xFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = CH_SPI,
|
||||
.end = CH_SPI,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
[2] = {
|
||||
.start = IRQ_SPI,
|
||||
.end = IRQ_SPI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
|
||||
/* SPI controller data */
|
||||
static struct bfin5xx_spi_master bfin_spi0_info = {
|
||||
.num_chipselect = 8,
|
||||
.enable_dma = 1, /* master has the ability to do dma transfer */
|
||||
.pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_spi0_device = {
|
||||
.name = "bfin-spi",
|
||||
.id = 0, /* Bus number */
|
||||
.num_resources = ARRAY_SIZE(bfin_spi0_resource),
|
||||
.resource = bfin_spi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_spi0_info, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif /* spi master and devices */
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
static struct platform_device rtc_device = {
|
||||
.name = "rtc-bfin",
|
||||
.id = -1,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
|
||||
static struct platform_device hitachi_fb_device = {
|
||||
.name = "hitachi-tx09",
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SMC91X)
|
||||
#include <linux/smc91x.h>
|
||||
|
||||
static struct smc91x_platdata smc91x_info = {
|
||||
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
|
||||
.leda = RPC_LED_100_10,
|
||||
.ledb = RPC_LED_TX_RX,
|
||||
};
|
||||
|
||||
static struct resource smc91x_resources[] = {
|
||||
{
|
||||
.start = 0x20200300,
|
||||
.end = 0x20200300 + 16,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PF14,
|
||||
.end = IRQ_PF14,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device smc91x_device = {
|
||||
.name = "smc91x",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(smc91x_resources),
|
||||
.resource = smc91x_resources,
|
||||
.dev = {
|
||||
.platform_data = &smc91x_info,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
static struct resource isp1362_hcd_resources[] = {
|
||||
{
|
||||
.start = 0x20308000,
|
||||
.end = 0x20308000,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = 0x20308004,
|
||||
.end = 0x20308004,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PG15,
|
||||
.end = IRQ_PG15,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
|
||||
},
|
||||
};
|
||||
|
||||
static struct isp1362_platform_data isp1362_priv = {
|
||||
.sel15Kres = 1,
|
||||
.clknotstop = 0,
|
||||
.oc_enable = 0,
|
||||
.int_act_high = 0,
|
||||
.int_edge_triggered = 0,
|
||||
.remote_wakeup_connected = 0,
|
||||
.no_power_switching = 1,
|
||||
.power_switching_mode = 0,
|
||||
};
|
||||
|
||||
static struct platform_device isp1362_hcd_device = {
|
||||
.name = "isp1362-hcd",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &isp1362_priv,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(isp1362_hcd_resources),
|
||||
.resource = isp1362_hcd_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
static struct resource net2272_bfin_resources[] = {
|
||||
{
|
||||
.start = 0x20300000,
|
||||
.end = 0x20300000 + 0x100,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PG13,
|
||||
.end = IRQ_PG13,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device net2272_bfin_device = {
|
||||
.name = "net2272",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(net2272_bfin_resources),
|
||||
.resource = net2272_bfin_resources,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
|
||||
static struct mtd_partition cm_partitions[] = {
|
||||
{
|
||||
.name = "bootloader(nor)",
|
||||
.size = 0x40000,
|
||||
.offset = 0,
|
||||
}, {
|
||||
.name = "linux kernel(nor)",
|
||||
.size = 0x100000,
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
}, {
|
||||
.name = "file system(nor)",
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
}
|
||||
};
|
||||
|
||||
static struct physmap_flash_data cm_flash_data = {
|
||||
.width = 2,
|
||||
.parts = cm_partitions,
|
||||
.nr_parts = ARRAY_SIZE(cm_partitions),
|
||||
};
|
||||
|
||||
static unsigned cm_flash_gpios[] = { GPIO_PF4, GPIO_PF5 };
|
||||
|
||||
static struct resource cm_flash_resource[] = {
|
||||
{
|
||||
.name = "cfi_probe",
|
||||
.start = 0x20000000,
|
||||
.end = 0x201fffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = (unsigned long)cm_flash_gpios,
|
||||
.end = ARRAY_SIZE(cm_flash_gpios),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device cm_flash_device = {
|
||||
.name = "gpio-addr-flash",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &cm_flash_data,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(cm_flash_resource),
|
||||
.resource = cm_flash_resource,
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
static struct resource bfin_uart0_resources[] = {
|
||||
{
|
||||
.start = UART0_THR,
|
||||
.end = UART0_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_TX,
|
||||
.end = IRQ_UART0_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_ERROR,
|
||||
.end = IRQ_UART0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_TX,
|
||||
.end = CH_UART0_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart0_peripherals[] = {
|
||||
P_UART0_TX, P_UART0_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart0_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart0_resources),
|
||||
.resource = bfin_uart0_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
static struct resource bfin_uart1_resources[] = {
|
||||
{
|
||||
.start = UART1_THR,
|
||||
.end = UART1_GCTL+2,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_TX,
|
||||
.end = IRQ_UART1_TX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_ERROR,
|
||||
.end = IRQ_UART1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_TX,
|
||||
.end = CH_UART1_TX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_uart1_peripherals[] = {
|
||||
P_UART1_TX, P_UART1_RX, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_uart1_device = {
|
||||
.name = "bfin-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_uart1_resources),
|
||||
.resource = bfin_uart1_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_uart1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
static struct resource bfin_sir0_resources[] = {
|
||||
{
|
||||
.start = 0xFFC00400,
|
||||
.end = 0xFFC004FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART0_RX,
|
||||
.end = IRQ_UART0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART0_RX,
|
||||
.end = CH_UART0_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sir0_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir0_resources),
|
||||
.resource = bfin_sir0_resources,
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
static struct resource bfin_sir1_resources[] = {
|
||||
{
|
||||
.start = 0xFFC02000,
|
||||
.end = 0xFFC020FF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_UART1_RX,
|
||||
.end = IRQ_UART1_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = CH_UART1_RX,
|
||||
.end = CH_UART1_RX+1,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sir1_device = {
|
||||
.name = "bfin_sir",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_sir1_resources),
|
||||
.resource = bfin_sir1_resources,
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
|
||||
|
||||
static struct resource bfin_twi0_resource[] = {
|
||||
[0] = {
|
||||
.start = TWI0_REGBASE,
|
||||
.end = TWI0_REGBASE,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_TWI,
|
||||
.end = IRQ_TWI,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device i2c_bfin_twi_device = {
|
||||
.name = "i2c-bfin-twi",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_twi0_resource),
|
||||
.resource = bfin_twi0_resource,
|
||||
.dev = {
|
||||
.platform_data = &bfin_twi0_pins,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
static struct resource bfin_sport0_uart_resources[] = {
|
||||
{
|
||||
.start = SPORT0_TCR1,
|
||||
.end = SPORT0_MRCS3+4,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_RX,
|
||||
.end = IRQ_SPORT0_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT0_ERROR,
|
||||
.end = IRQ_SPORT0_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_sport0_peripherals[] = {
|
||||
P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
|
||||
P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport0_uart_device = {
|
||||
.name = "bfin-sport-uart",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
|
||||
.resource = bfin_sport0_uart_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport0_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
static struct resource bfin_sport1_uart_resources[] = {
|
||||
{
|
||||
.start = SPORT1_TCR1,
|
||||
.end = SPORT1_MRCS3+4,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT1_RX,
|
||||
.end = IRQ_SPORT1_RX+1,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
{
|
||||
.start = IRQ_SPORT1_ERROR,
|
||||
.end = IRQ_SPORT1_ERROR,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static unsigned short bfin_sport1_peripherals[] = {
|
||||
P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
|
||||
P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
|
||||
};
|
||||
|
||||
static struct platform_device bfin_sport1_uart_device = {
|
||||
.name = "bfin-sport-uart",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
|
||||
.resource = bfin_sport1_uart_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_sport1_peripherals, /* Passed to driver */
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
#include <linux/bfin_mac.h>
|
||||
static const unsigned short bfin_mac_peripherals[] = P_MII0;
|
||||
|
||||
static struct bfin_phydev_platform_data bfin_phydev_data[] = {
|
||||
{
|
||||
.addr = 1,
|
||||
.irq = IRQ_MAC_PHYINT,
|
||||
},
|
||||
};
|
||||
|
||||
static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
|
||||
.phydev_number = 1,
|
||||
.phydev_data = bfin_phydev_data,
|
||||
.phy_mode = PHY_INTERFACE_MODE_MII,
|
||||
.mac_peripherals = bfin_mac_peripherals,
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mii_bus = {
|
||||
.name = "bfin_mii_bus",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus_data,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device bfin_mac_device = {
|
||||
.name = "bfin_mac",
|
||||
.dev = {
|
||||
.platform_data = &bfin_mii_bus,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PATA_PLATFORM)
|
||||
#define PATA_INT IRQ_PF14
|
||||
|
||||
static struct pata_platform_info bfin_pata_platform_data = {
|
||||
.ioport_shift = 2,
|
||||
};
|
||||
|
||||
static struct resource bfin_pata_resources[] = {
|
||||
{
|
||||
.start = 0x2030C000,
|
||||
.end = 0x2030C01F,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = 0x2030D018,
|
||||
.end = 0x2030D01B,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = PATA_INT,
|
||||
.end = PATA_INT,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device bfin_pata_device = {
|
||||
.name = "pata_platform",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(bfin_pata_resources),
|
||||
.resource = bfin_pata_resources,
|
||||
.dev = {
|
||||
.platform_data = &bfin_pata_platform_data,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
static const unsigned int cclk_vlev_datasheet[] =
|
||||
{
|
||||
VRPAIR(VLEV_085, 250000000),
|
||||
VRPAIR(VLEV_090, 376000000),
|
||||
VRPAIR(VLEV_095, 426000000),
|
||||
VRPAIR(VLEV_100, 426000000),
|
||||
VRPAIR(VLEV_105, 476000000),
|
||||
VRPAIR(VLEV_110, 476000000),
|
||||
VRPAIR(VLEV_115, 476000000),
|
||||
VRPAIR(VLEV_120, 500000000),
|
||||
VRPAIR(VLEV_125, 533000000),
|
||||
VRPAIR(VLEV_130, 600000000),
|
||||
};
|
||||
|
||||
static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
|
||||
.tuple_tab = cclk_vlev_datasheet,
|
||||
.tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
|
||||
.vr_settling_time = 25 /* us */,
|
||||
};
|
||||
|
||||
static struct platform_device bfin_dpmc = {
|
||||
.name = "bfin dpmc",
|
||||
.dev = {
|
||||
.platform_data = &bfin_dmpc_vreg_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *cm_bf537_devices[] __initdata = {
|
||||
|
||||
&bfin_dpmc,
|
||||
|
||||
#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
|
||||
&hitachi_fb_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
|
||||
&rtc_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_SIR)
|
||||
#ifdef CONFIG_BFIN_SIR0
|
||||
&bfin_sir0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_BFIN_SIR1
|
||||
&bfin_sir1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
|
||||
&i2c_bfin_twi_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
&bfin_sport0_uart_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
&bfin_sport1_uart_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
|
||||
&isp1362_hcd_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SMC91X)
|
||||
&smc91x_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_BFIN_MAC)
|
||||
&bfin_mii_bus,
|
||||
&bfin_mac_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
&net2272_bfin_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
&bfin_spi0_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PATA_PLATFORM)
|
||||
&bfin_pata_device,
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
|
||||
&cm_flash_device,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __init net2272_init(void)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_USB_NET2272)
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(GPIO_PG14, "net2272");
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Reset USB Chip, PG14 */
|
||||
gpio_direction_output(GPIO_PG14, 0);
|
||||
mdelay(2);
|
||||
gpio_set_value(GPIO_PG14, 1);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init tcm_bf537_init(void)
|
||||
{
|
||||
printk(KERN_INFO "%s(): registering device resources\n", __func__);
|
||||
platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices));
|
||||
#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
|
||||
spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_PATA_PLATFORM)
|
||||
irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
|
||||
#endif
|
||||
|
||||
if (net2272_init())
|
||||
pr_warning("unable to configure net2272; it probably won't work\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
arch_initcall(tcm_bf537_init);
|
||||
|
||||
static struct platform_device *cm_bf537_early_devices[] __initdata = {
|
||||
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
&bfin_uart0_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
&bfin_uart1_device,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
|
||||
&bfin_sport0_uart_device,
|
||||
#endif
|
||||
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
|
||||
&bfin_sport1_uart_device,
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
void __init native_machine_early_platform_add_devices(void)
|
||||
{
|
||||
printk(KERN_INFO "register early platform devices\n");
|
||||
early_platform_add_devices(cm_bf537_early_devices,
|
||||
ARRAY_SIZE(cm_bf537_early_devices));
|
||||
}
|
||||
|
||||
int bfin_get_ether_addr(char *addr)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL(bfin_get_ether_addr);
|
98
arch/blackfin/mach-bf537/dma.c
Normal file
98
arch/blackfin/mach-bf537/dma.c
Normal file
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* Copyright 2007-2009 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*
|
||||
* This file contains the simple DMA Implementation for Blackfin
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/blackfin.h>
|
||||
#include <asm/dma.h>
|
||||
|
||||
struct dma_register * const dma_io_base_addr[MAX_DMA_CHANNELS] = {
|
||||
(struct dma_register *) DMA0_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA1_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA2_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA3_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA4_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA5_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA6_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA7_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA8_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA9_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA10_NEXT_DESC_PTR,
|
||||
(struct dma_register *) DMA11_NEXT_DESC_PTR,
|
||||
(struct dma_register *) MDMA_D0_NEXT_DESC_PTR,
|
||||
(struct dma_register *) MDMA_S0_NEXT_DESC_PTR,
|
||||
(struct dma_register *) MDMA_D1_NEXT_DESC_PTR,
|
||||
(struct dma_register *) MDMA_S1_NEXT_DESC_PTR,
|
||||
};
|
||||
EXPORT_SYMBOL(dma_io_base_addr);
|
||||
|
||||
int channel2irq(unsigned int channel)
|
||||
{
|
||||
int ret_irq = -1;
|
||||
|
||||
switch (channel) {
|
||||
case CH_PPI:
|
||||
ret_irq = IRQ_PPI;
|
||||
break;
|
||||
|
||||
case CH_EMAC_RX:
|
||||
ret_irq = IRQ_MAC_RX;
|
||||
break;
|
||||
|
||||
case CH_EMAC_TX:
|
||||
ret_irq = IRQ_MAC_TX;
|
||||
break;
|
||||
|
||||
case CH_UART1_RX:
|
||||
ret_irq = IRQ_UART1_RX;
|
||||
break;
|
||||
|
||||
case CH_UART1_TX:
|
||||
ret_irq = IRQ_UART1_TX;
|
||||
break;
|
||||
|
||||
case CH_SPORT0_RX:
|
||||
ret_irq = IRQ_SPORT0_RX;
|
||||
break;
|
||||
|
||||
case CH_SPORT0_TX:
|
||||
ret_irq = IRQ_SPORT0_TX;
|
||||
break;
|
||||
|
||||
case CH_SPORT1_RX:
|
||||
ret_irq = IRQ_SPORT1_RX;
|
||||
break;
|
||||
|
||||
case CH_SPORT1_TX:
|
||||
ret_irq = IRQ_SPORT1_TX;
|
||||
break;
|
||||
|
||||
case CH_SPI:
|
||||
ret_irq = IRQ_SPI;
|
||||
break;
|
||||
|
||||
case CH_UART0_RX:
|
||||
ret_irq = IRQ_UART0_RX;
|
||||
break;
|
||||
|
||||
case CH_UART0_TX:
|
||||
ret_irq = IRQ_UART0_TX;
|
||||
break;
|
||||
|
||||
case CH_MEM_STREAM0_SRC:
|
||||
case CH_MEM_STREAM0_DEST:
|
||||
ret_irq = IRQ_MEM_DMA0;
|
||||
break;
|
||||
|
||||
case CH_MEM_STREAM1_SRC:
|
||||
case CH_MEM_STREAM1_DEST:
|
||||
ret_irq = IRQ_MEM_DMA1;
|
||||
break;
|
||||
}
|
||||
return ret_irq;
|
||||
}
|
241
arch/blackfin/mach-bf537/include/mach/anomaly.h
Normal file
241
arch/blackfin/mach-bf537/include/mach/anomaly.h
Normal file
|
@ -0,0 +1,241 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE
|
||||
* This file is under version control at
|
||||
* svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
|
||||
* and can be replaced with that version at any time
|
||||
* DO NOT EDIT THIS FILE
|
||||
*
|
||||
* Copyright 2004-2011 Analog Devices Inc.
|
||||
* Licensed under the Clear BSD license.
|
||||
*/
|
||||
|
||||
/* This file should be up to date with:
|
||||
* - Revision F, 05/23/2011; ADSP-BF534/ADSP-BF536/ADSP-BF537 Blackfin Processor Anomaly List
|
||||
*/
|
||||
|
||||
#ifndef _MACH_ANOMALY_H_
|
||||
#define _MACH_ANOMALY_H_
|
||||
|
||||
/* We do not support 0.1 silicon - sorry */
|
||||
#if __SILICON_REVISION__ < 2
|
||||
# error will not work on BF537 silicon version 0.0 or 0.1
|
||||
#endif
|
||||
|
||||
#if defined(__ADSPBF534__)
|
||||
# define ANOMALY_BF534 1
|
||||
#else
|
||||
# define ANOMALY_BF534 0
|
||||
#endif
|
||||
#if defined(__ADSPBF536__)
|
||||
# define ANOMALY_BF536 1
|
||||
#else
|
||||
# define ANOMALY_BF536 0
|
||||
#endif
|
||||
#if defined(__ADSPBF537__)
|
||||
# define ANOMALY_BF537 1
|
||||
#else
|
||||
# define ANOMALY_BF537 0
|
||||
#endif
|
||||
|
||||
/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */
|
||||
#define ANOMALY_05000074 (1)
|
||||
/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
|
||||
#define ANOMALY_05000119 (1)
|
||||
/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
|
||||
#define ANOMALY_05000122 (1)
|
||||
/* PPI_DELAY Not Functional in PPI Modes with 0 Frame Syncs */
|
||||
#define ANOMALY_05000180 (1)
|
||||
/* If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control Causes Failures */
|
||||
#define ANOMALY_05000244 (__SILICON_REVISION__ < 3)
|
||||
/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
|
||||
#define ANOMALY_05000245 (1)
|
||||
/* Incorrect Bit Shift of Data Word in Multichannel (TDM) Mode in Certain Conditions */
|
||||
#define ANOMALY_05000250 (__SILICON_REVISION__ < 3)
|
||||
/* EMAC TX DMA Error After an Early Frame Abort */
|
||||
#define ANOMALY_05000252 (__SILICON_REVISION__ < 3)
|
||||
/* Maximum External Clock Speed for Timers */
|
||||
#define ANOMALY_05000253 (__SILICON_REVISION__ < 3)
|
||||
/* Incorrect Timer Pulse Width in Single-Shot PWM_OUT Mode with External Clock */
|
||||
#define ANOMALY_05000254 (__SILICON_REVISION__ > 2)
|
||||
/* Entering Hibernate State with RTC Seconds Interrupt Not Functional */
|
||||
#define ANOMALY_05000255 (__SILICON_REVISION__ < 3)
|
||||
/* EMAC MDIO Input Latched on Wrong MDC Edge */
|
||||
#define ANOMALY_05000256 (__SILICON_REVISION__ < 3)
|
||||
/* Interrupt/Exception During Short Hardware Loop May Cause Bad Instruction Fetches */
|
||||
#define ANOMALY_05000257 (__SILICON_REVISION__ < 3)
|
||||
/* Instruction Cache Is Corrupted When Bits 9 and 12 of the ICPLB Data Registers Differ */
|
||||
#define ANOMALY_05000258 (((ANOMALY_BF536 || ANOMALY_BF537) && __SILICON_REVISION__ == 1) || __SILICON_REVISION__ == 2)
|
||||
/* ICPLB_STATUS MMR Register May Be Corrupted */
|
||||
#define ANOMALY_05000260 (__SILICON_REVISION__ == 2)
|
||||
/* DCPLB_FAULT_ADDR MMR Register May Be Corrupted */
|
||||
#define ANOMALY_05000261 (__SILICON_REVISION__ < 3)
|
||||
/* Stores To Data Cache May Be Lost */
|
||||
#define ANOMALY_05000262 (__SILICON_REVISION__ < 3)
|
||||
/* Hardware Loop Corrupted When Taking an ICPLB Exception */
|
||||
#define ANOMALY_05000263 (__SILICON_REVISION__ == 2)
|
||||
/* CSYNC/SSYNC/IDLE Causes Infinite Stall in Penultimate Instruction in Hardware Loop */
|
||||
#define ANOMALY_05000264 (__SILICON_REVISION__ < 3)
|
||||
/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
|
||||
#define ANOMALY_05000265 (1)
|
||||
/* Memory DMA Error when Peripheral DMA Is Running with Non-Zero DEB_TRAFFIC_PERIOD */
|
||||
#define ANOMALY_05000268 (__SILICON_REVISION__ < 3)
|
||||
/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Decrease */
|
||||
#define ANOMALY_05000270 (__SILICON_REVISION__ < 3)
|
||||
/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */
|
||||
#define ANOMALY_05000272 (1)
|
||||
/* Writes to Synchronous SDRAM Memory May Be Lost */
|
||||
#define ANOMALY_05000273 (__SILICON_REVISION__ < 3)
|
||||
/* Writes to an I/O Data Register One SCLK Cycle after an Edge Is Detected May Clear Interrupt */
|
||||
#define ANOMALY_05000277 (__SILICON_REVISION__ < 3)
|
||||
/* Disabling Peripherals with DMA Running May Cause DMA System Instability */
|
||||
#define ANOMALY_05000278 (((ANOMALY_BF536 || ANOMALY_BF537) && __SILICON_REVISION__ < 3) || (ANOMALY_BF534 && __SILICON_REVISION__ < 2))
|
||||
/* SPI Master Boot Mode Does Not Work Well with Atmel Data Flash Devices */
|
||||
#define ANOMALY_05000280 (1)
|
||||
/* False Hardware Error when ISR Context Is Not Restored */
|
||||
#define ANOMALY_05000281 (__SILICON_REVISION__ < 3)
|
||||
/* Memory DMA Corruption with 32-Bit Data and Traffic Control */
|
||||
#define ANOMALY_05000282 (__SILICON_REVISION__ < 3)
|
||||
/* System MMR Write Is Stalled Indefinitely when Killed in a Particular Stage */
|
||||
#define ANOMALY_05000283 (__SILICON_REVISION__ < 3)
|
||||
/* TXDWA Bit in EMAC_SYSCTL Register Is Not Functional */
|
||||
#define ANOMALY_05000285 (__SILICON_REVISION__ < 3)
|
||||
/* SPORTs May Receive Bad Data If FIFOs Fill Up */
|
||||
#define ANOMALY_05000288 (__SILICON_REVISION__ < 3)
|
||||
/* Memory-To-Memory DMA Source/Destination Descriptors Must Be in Same Memory Space */
|
||||
#define ANOMALY_05000301 (1)
|
||||
/* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */
|
||||
#define ANOMALY_05000304 (__SILICON_REVISION__ < 3)
|
||||
/* SPORT_HYS Bit in PLL_CTL Register Is Not Functional */
|
||||
#define ANOMALY_05000305 (__SILICON_REVISION__ < 3)
|
||||
/* SCKELOW Bit Does Not Maintain State Through Hibernate */
|
||||
#define ANOMALY_05000307 (__SILICON_REVISION__ < 3)
|
||||
/* Writing UART_THR While UART Clock Is Disabled Sends Erroneous Start Bit */
|
||||
#define ANOMALY_05000309 (__SILICON_REVISION__ < 3)
|
||||
/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
|
||||
#define ANOMALY_05000310 (1)
|
||||
/* Errors when SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
|
||||
#define ANOMALY_05000312 (1)
|
||||
/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */
|
||||
#define ANOMALY_05000313 (1)
|
||||
/* Killed System MMR Write Completes Erroneously on Next System MMR Access */
|
||||
#define ANOMALY_05000315 (__SILICON_REVISION__ < 3)
|
||||
/* EMAC RMII Mode: Collisions Occur in Full Duplex Mode */
|
||||
#define ANOMALY_05000316 (__SILICON_REVISION__ < 3)
|
||||
/* EMAC RMII Mode: TX Frames in Half Duplex Fail with Status "No Carrier" */
|
||||
#define ANOMALY_05000321 (__SILICON_REVISION__ < 3)
|
||||
/* EMAC RMII Mode at 10-Base-T Speed: RX Frames Not Received Properly */
|
||||
#define ANOMALY_05000322 (1)
|
||||
/* Ethernet MAC MDIO Reads Do Not Meet IEEE Specification */
|
||||
#define ANOMALY_05000341 (__SILICON_REVISION__ >= 3)
|
||||
/* UART Gets Disabled after UART Boot */
|
||||
#define ANOMALY_05000350 (__SILICON_REVISION__ >= 3)
|
||||
/* Regulator Programming Blocked when Hibernate Wakeup Source Remains Active */
|
||||
#define ANOMALY_05000355 (1)
|
||||
/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */
|
||||
#define ANOMALY_05000357 (1)
|
||||
/* DMAs that Go Urgent during Tight Core Writes to External Memory Are Blocked */
|
||||
#define ANOMALY_05000359 (1)
|
||||
/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */
|
||||
#define ANOMALY_05000366 (1)
|
||||
/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
|
||||
#define ANOMALY_05000371 (1)
|
||||
/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */
|
||||
#define ANOMALY_05000402 (__SILICON_REVISION__ == 2)
|
||||
/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
|
||||
#define ANOMALY_05000403 (1)
|
||||
/* Speculative Fetches Can Cause Undesired External FIFO Operations */
|
||||
#define ANOMALY_05000416 (1)
|
||||
/* Multichannel SPORT Channel Misalignment Under Specific Configuration */
|
||||
#define ANOMALY_05000425 (1)
|
||||
/* Speculative Fetches of Indirect-Pointer Instructions Can Cause False Hardware Errors */
|
||||
#define ANOMALY_05000426 (1)
|
||||
/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
|
||||
#define ANOMALY_05000443 (1)
|
||||
/* False Hardware Error when RETI Points to Invalid Memory */
|
||||
#define ANOMALY_05000461 (1)
|
||||
/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */
|
||||
#define ANOMALY_05000462 (1)
|
||||
/* Interrupted SPORT Receive Data Register Read Results In Underflow when SLEN > 15 */
|
||||
#define ANOMALY_05000473 (1)
|
||||
/* Possible Lockup Condition when Modifying PLL from External Memory */
|
||||
#define ANOMALY_05000475 (1)
|
||||
/* TESTSET Instruction Cannot Be Interrupted */
|
||||
#define ANOMALY_05000477 (1)
|
||||
/* Multiple Simultaneous Urgent DMA Requests May Cause DMA System Instability */
|
||||
#define ANOMALY_05000480 (__SILICON_REVISION__ < 3)
|
||||
/* Reads of ITEST_COMMAND and ITEST_DATA Registers Cause Cache Corruption */
|
||||
#define ANOMALY_05000481 (1)
|
||||
/* PLL May Latch Incorrect Values Coming Out of Reset */
|
||||
#define ANOMALY_05000489 (1)
|
||||
/* Instruction Memory Stalls Can Cause IFLUSH to Fail */
|
||||
#define ANOMALY_05000491 (1)
|
||||
/* EXCPT Instruction May Be Lost If NMI Happens Simultaneously */
|
||||
#define ANOMALY_05000494 (1)
|
||||
/* RXS Bit in SPI_STAT May Become Stuck In RX DMA Modes */
|
||||
#define ANOMALY_05000501 (1)
|
||||
|
||||
/*
|
||||
* These anomalies have been "phased" out of analog.com anomaly sheets and are
|
||||
* here to show running on older silicon just isn't feasible.
|
||||
*/
|
||||
|
||||
/* Killed 32-Bit MMR Write Leads to Next System MMR Access Thinking It Should Be 32-Bit */
|
||||
#define ANOMALY_05000157 (__SILICON_REVISION__ < 2)
|
||||
/* Instruction Cache Is Not Functional */
|
||||
#define ANOMALY_05000237 (__SILICON_REVISION__ < 2)
|
||||
/* Buffered CLKIN Output Is Disabled by Default */
|
||||
#define ANOMALY_05000247 (__SILICON_REVISION__ < 2)
|
||||
|
||||
/* Anomalies that don't exist on this proc */
|
||||
#define ANOMALY_05000099 (0)
|
||||
#define ANOMALY_05000120 (0)
|
||||
#define ANOMALY_05000125 (0)
|
||||
#define ANOMALY_05000149 (0)
|
||||
#define ANOMALY_05000158 (0)
|
||||
#define ANOMALY_05000171 (0)
|
||||
#define ANOMALY_05000179 (0)
|
||||
#define ANOMALY_05000182 (0)
|
||||
#define ANOMALY_05000183 (0)
|
||||
#define ANOMALY_05000189 (0)
|
||||
#define ANOMALY_05000198 (0)
|
||||
#define ANOMALY_05000202 (0)
|
||||
#define ANOMALY_05000215 (0)
|
||||
#define ANOMALY_05000219 (0)
|
||||
#define ANOMALY_05000220 (0)
|
||||
#define ANOMALY_05000227 (0)
|
||||
#define ANOMALY_05000230 (0)
|
||||
#define ANOMALY_05000231 (0)
|
||||
#define ANOMALY_05000233 (0)
|
||||
#define ANOMALY_05000234 (0)
|
||||
#define ANOMALY_05000242 (0)
|
||||
#define ANOMALY_05000248 (0)
|
||||
#define ANOMALY_05000266 (0)
|
||||
#define ANOMALY_05000274 (0)
|
||||
#define ANOMALY_05000287 (0)
|
||||
#define ANOMALY_05000311 (0)
|
||||
#define ANOMALY_05000323 (0)
|
||||
#define ANOMALY_05000353 (1)
|
||||
#define ANOMALY_05000362 (1)
|
||||
#define ANOMALY_05000363 (0)
|
||||
#define ANOMALY_05000364 (0)
|
||||
#define ANOMALY_05000380 (0)
|
||||
#define ANOMALY_05000383 (0)
|
||||
#define ANOMALY_05000386 (1)
|
||||
#define ANOMALY_05000389 (0)
|
||||
#define ANOMALY_05000400 (0)
|
||||
#define ANOMALY_05000412 (0)
|
||||
#define ANOMALY_05000430 (0)
|
||||
#define ANOMALY_05000432 (0)
|
||||
#define ANOMALY_05000435 (0)
|
||||
#define ANOMALY_05000440 (0)
|
||||
#define ANOMALY_05000447 (0)
|
||||
#define ANOMALY_05000448 (0)
|
||||
#define ANOMALY_05000456 (0)
|
||||
#define ANOMALY_05000450 (0)
|
||||
#define ANOMALY_05000465 (0)
|
||||
#define ANOMALY_05000467 (0)
|
||||
#define ANOMALY_05000474 (0)
|
||||
#define ANOMALY_05000485 (0)
|
||||
#define ANOMALY_16000030 (0)
|
||||
|
||||
#endif
|
108
arch/blackfin/mach-bf537/include/mach/bf537.h
Normal file
108
arch/blackfin/mach-bf537/include/mach/bf537.h
Normal file
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* System MMR Register and memory map for ADSP-BF537
|
||||
*
|
||||
* Copyright 2005-2008 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef __MACH_BF537_H__
|
||||
#define __MACH_BF537_H__
|
||||
|
||||
#define OFFSET_(x) ((x) & 0x0000FFFF)
|
||||
|
||||
/*some misc defines*/
|
||||
#define IMASK_IVG15 0x8000
|
||||
#define IMASK_IVG14 0x4000
|
||||
#define IMASK_IVG13 0x2000
|
||||
#define IMASK_IVG12 0x1000
|
||||
|
||||
#define IMASK_IVG11 0x0800
|
||||
#define IMASK_IVG10 0x0400
|
||||
#define IMASK_IVG9 0x0200
|
||||
#define IMASK_IVG8 0x0100
|
||||
|
||||
#define IMASK_IVG7 0x0080
|
||||
#define IMASK_IVGTMR 0x0040
|
||||
#define IMASK_IVGHW 0x0020
|
||||
|
||||
/***************************/
|
||||
|
||||
|
||||
#define BFIN_DSUBBANKS 4
|
||||
#define BFIN_DWAYS 2
|
||||
#define BFIN_DLINES 64
|
||||
#define BFIN_ISUBBANKS 4
|
||||
#define BFIN_IWAYS 4
|
||||
#define BFIN_ILINES 32
|
||||
|
||||
#define WAY0_L 0x1
|
||||
#define WAY1_L 0x2
|
||||
#define WAY01_L 0x3
|
||||
#define WAY2_L 0x4
|
||||
#define WAY02_L 0x5
|
||||
#define WAY12_L 0x6
|
||||
#define WAY012_L 0x7
|
||||
|
||||
#define WAY3_L 0x8
|
||||
#define WAY03_L 0x9
|
||||
#define WAY13_L 0xA
|
||||
#define WAY013_L 0xB
|
||||
|
||||
#define WAY32_L 0xC
|
||||
#define WAY320_L 0xD
|
||||
#define WAY321_L 0xE
|
||||
#define WAYALL_L 0xF
|
||||
|
||||
#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
|
||||
|
||||
/********************************* EBIU Settings ************************************/
|
||||
#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
|
||||
#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
|
||||
|
||||
#ifdef CONFIG_C_AMBEN_ALL
|
||||
#define V_AMBEN AMBEN_ALL
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN
|
||||
#define V_AMBEN 0x0
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN_B0
|
||||
#define V_AMBEN AMBEN_B0
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN_B0_B1
|
||||
#define V_AMBEN AMBEN_B0_B1
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMBEN_B0_B1_B2
|
||||
#define V_AMBEN AMBEN_B0_B1_B2
|
||||
#endif
|
||||
#ifdef CONFIG_C_AMCKEN
|
||||
#define V_AMCKEN AMCKEN
|
||||
#else
|
||||
#define V_AMCKEN 0x0
|
||||
#endif
|
||||
#ifdef CONFIG_C_CDPRIO
|
||||
#define V_CDPRIO 0x100
|
||||
#else
|
||||
#define V_CDPRIO 0x0
|
||||
#endif
|
||||
|
||||
#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO)
|
||||
|
||||
#ifdef CONFIG_BF537
|
||||
#define CPU "BF537"
|
||||
#define CPUID 0x27c8
|
||||
#endif
|
||||
#ifdef CONFIG_BF536
|
||||
#define CPU "BF536"
|
||||
#define CPUID 0x27c8
|
||||
#endif
|
||||
#ifdef CONFIG_BF534
|
||||
#define CPU "BF534"
|
||||
#define CPUID 0x27c6
|
||||
#endif
|
||||
|
||||
#ifndef CPU
|
||||
#error "Unknown CPU type - This kernel doesn't seem to be configured properly"
|
||||
#endif
|
||||
|
||||
#endif /* __MACH_BF537_H__ */
|
14
arch/blackfin/mach-bf537/include/mach/bfin_serial.h
Normal file
14
arch/blackfin/mach-bf537/include/mach/bfin_serial.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* mach/bfin_serial.h - Blackfin UART/Serial definitions
|
||||
*
|
||||
* Copyright 2006-2010 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef __BFIN_MACH_SERIAL_H__
|
||||
#define __BFIN_MACH_SERIAL_H__
|
||||
|
||||
#define BFIN_UART_NR_PORTS 2
|
||||
|
||||
#endif
|
33
arch/blackfin/mach-bf537/include/mach/blackfin.h
Normal file
33
arch/blackfin/mach-bf537/include/mach/blackfin.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright 2005-2010 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef _MACH_BLACKFIN_H_
|
||||
#define _MACH_BLACKFIN_H_
|
||||
|
||||
#define BF537_FAMILY
|
||||
|
||||
#include "bf537.h"
|
||||
#include "anomaly.h"
|
||||
|
||||
#include <asm/def_LPBlackfin.h>
|
||||
#ifdef CONFIG_BF534
|
||||
# include "defBF534.h"
|
||||
#endif
|
||||
#if defined(CONFIG_BF537) || defined(CONFIG_BF536)
|
||||
# include "defBF537.h"
|
||||
#endif
|
||||
|
||||
#if !defined(__ASSEMBLY__)
|
||||
# include <asm/cdef_LPBlackfin.h>
|
||||
# ifdef CONFIG_BF534
|
||||
# include "cdefBF534.h"
|
||||
# endif
|
||||
# if defined(CONFIG_BF537) || defined(CONFIG_BF536)
|
||||
# include "cdefBF537.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
1736
arch/blackfin/mach-bf537/include/mach/cdefBF534.h
Normal file
1736
arch/blackfin/mach-bf537/include/mach/cdefBF534.h
Normal file
File diff suppressed because it is too large
Load diff
178
arch/blackfin/mach-bf537/include/mach/cdefBF537.h
Normal file
178
arch/blackfin/mach-bf537/include/mach/cdefBF537.h
Normal file
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
* Copyright 2005-2010 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later
|
||||
*/
|
||||
|
||||
#ifndef _CDEF_BF537_H
|
||||
#define _CDEF_BF537_H
|
||||
|
||||
/* Include MMRs Common to BF534 */
|
||||
#include "cdefBF534.h"
|
||||
|
||||
/* Include Macro "Defines" For EMAC (Unique to BF536/BF537 */
|
||||
/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
|
||||
#define bfin_read_EMAC_OPMODE() bfin_read32(EMAC_OPMODE)
|
||||
#define bfin_write_EMAC_OPMODE(val) bfin_write32(EMAC_OPMODE,val)
|
||||
#define bfin_read_EMAC_ADDRLO() bfin_read32(EMAC_ADDRLO)
|
||||
#define bfin_write_EMAC_ADDRLO(val) bfin_write32(EMAC_ADDRLO,val)
|
||||
#define bfin_read_EMAC_ADDRHI() bfin_read32(EMAC_ADDRHI)
|
||||
#define bfin_write_EMAC_ADDRHI(val) bfin_write32(EMAC_ADDRHI,val)
|
||||
#define bfin_read_EMAC_HASHLO() bfin_read32(EMAC_HASHLO)
|
||||
#define bfin_write_EMAC_HASHLO(val) bfin_write32(EMAC_HASHLO,val)
|
||||
#define bfin_read_EMAC_HASHHI() bfin_read32(EMAC_HASHHI)
|
||||
#define bfin_write_EMAC_HASHHI(val) bfin_write32(EMAC_HASHHI,val)
|
||||
#define bfin_read_EMAC_STAADD() bfin_read32(EMAC_STAADD)
|
||||
#define bfin_write_EMAC_STAADD(val) bfin_write32(EMAC_STAADD,val)
|
||||
#define bfin_read_EMAC_STADAT() bfin_read32(EMAC_STADAT)
|
||||
#define bfin_write_EMAC_STADAT(val) bfin_write32(EMAC_STADAT,val)
|
||||
#define bfin_read_EMAC_FLC() bfin_read32(EMAC_FLC)
|
||||
#define bfin_write_EMAC_FLC(val) bfin_write32(EMAC_FLC,val)
|
||||
#define bfin_read_EMAC_VLAN1() bfin_read32(EMAC_VLAN1)
|
||||
#define bfin_write_EMAC_VLAN1(val) bfin_write32(EMAC_VLAN1,val)
|
||||
#define bfin_read_EMAC_VLAN2() bfin_read32(EMAC_VLAN2)
|
||||
#define bfin_write_EMAC_VLAN2(val) bfin_write32(EMAC_VLAN2,val)
|
||||
#define bfin_read_EMAC_WKUP_CTL() bfin_read32(EMAC_WKUP_CTL)
|
||||
#define bfin_write_EMAC_WKUP_CTL(val) bfin_write32(EMAC_WKUP_CTL,val)
|
||||
#define bfin_read_EMAC_WKUP_FFMSK0() bfin_read32(EMAC_WKUP_FFMSK0)
|
||||
#define bfin_write_EMAC_WKUP_FFMSK0(val) bfin_write32(EMAC_WKUP_FFMSK0,val)
|
||||
#define bfin_read_EMAC_WKUP_FFMSK1() bfin_read32(EMAC_WKUP_FFMSK1)
|
||||
#define bfin_write_EMAC_WKUP_FFMSK1(val) bfin_write32(EMAC_WKUP_FFMSK1,val)
|
||||
#define bfin_read_EMAC_WKUP_FFMSK2() bfin_read32(EMAC_WKUP_FFMSK2)
|
||||
#define bfin_write_EMAC_WKUP_FFMSK2(val) bfin_write32(EMAC_WKUP_FFMSK2,val)
|
||||
#define bfin_read_EMAC_WKUP_FFMSK3() bfin_read32(EMAC_WKUP_FFMSK3)
|
||||
#define bfin_write_EMAC_WKUP_FFMSK3(val) bfin_write32(EMAC_WKUP_FFMSK3,val)
|
||||
#define bfin_read_EMAC_WKUP_FFCMD() bfin_read32(EMAC_WKUP_FFCMD)
|
||||
#define bfin_write_EMAC_WKUP_FFCMD(val) bfin_write32(EMAC_WKUP_FFCMD,val)
|
||||
#define bfin_read_EMAC_WKUP_FFOFF() bfin_read32(EMAC_WKUP_FFOFF)
|
||||
#define bfin_write_EMAC_WKUP_FFOFF(val) bfin_write32(EMAC_WKUP_FFOFF,val)
|
||||
#define bfin_read_EMAC_WKUP_FFCRC0() bfin_read32(EMAC_WKUP_FFCRC0)
|
||||
#define bfin_write_EMAC_WKUP_FFCRC0(val) bfin_write32(EMAC_WKUP_FFCRC0,val)
|
||||
#define bfin_read_EMAC_WKUP_FFCRC1() bfin_read32(EMAC_WKUP_FFCRC1)
|
||||
#define bfin_write_EMAC_WKUP_FFCRC1(val) bfin_write32(EMAC_WKUP_FFCRC1,val)
|
||||
|
||||
#define bfin_read_EMAC_SYSCTL() bfin_read32(EMAC_SYSCTL)
|
||||
#define bfin_write_EMAC_SYSCTL(val) bfin_write32(EMAC_SYSCTL,val)
|
||||
#define bfin_read_EMAC_SYSTAT() bfin_read32(EMAC_SYSTAT)
|
||||
#define bfin_write_EMAC_SYSTAT(val) bfin_write32(EMAC_SYSTAT,val)
|
||||
#define bfin_read_EMAC_RX_STAT() bfin_read32(EMAC_RX_STAT)
|
||||
#define bfin_write_EMAC_RX_STAT(val) bfin_write32(EMAC_RX_STAT,val)
|
||||
#define bfin_read_EMAC_RX_STKY() bfin_read32(EMAC_RX_STKY)
|
||||
#define bfin_write_EMAC_RX_STKY(val) bfin_write32(EMAC_RX_STKY,val)
|
||||
#define bfin_read_EMAC_RX_IRQE() bfin_read32(EMAC_RX_IRQE)
|
||||
#define bfin_write_EMAC_RX_IRQE(val) bfin_write32(EMAC_RX_IRQE,val)
|
||||
#define bfin_read_EMAC_TX_STAT() bfin_read32(EMAC_TX_STAT)
|
||||
#define bfin_write_EMAC_TX_STAT(val) bfin_write32(EMAC_TX_STAT,val)
|
||||
#define bfin_read_EMAC_TX_STKY() bfin_read32(EMAC_TX_STKY)
|
||||
#define bfin_write_EMAC_TX_STKY(val) bfin_write32(EMAC_TX_STKY,val)
|
||||
#define bfin_read_EMAC_TX_IRQE() bfin_read32(EMAC_TX_IRQE)
|
||||
#define bfin_write_EMAC_TX_IRQE(val) bfin_write32(EMAC_TX_IRQE,val)
|
||||
|
||||
#define bfin_read_EMAC_MMC_CTL() bfin_read32(EMAC_MMC_CTL)
|
||||
#define bfin_write_EMAC_MMC_CTL(val) bfin_write32(EMAC_MMC_CTL,val)
|
||||
#define bfin_read_EMAC_MMC_RIRQS() bfin_read32(EMAC_MMC_RIRQS)
|
||||
#define bfin_write_EMAC_MMC_RIRQS(val) bfin_write32(EMAC_MMC_RIRQS,val)
|
||||
#define bfin_read_EMAC_MMC_RIRQE() bfin_read32(EMAC_MMC_RIRQE)
|
||||
#define bfin_write_EMAC_MMC_RIRQE(val) bfin_write32(EMAC_MMC_RIRQE,val)
|
||||
#define bfin_read_EMAC_MMC_TIRQS() bfin_read32(EMAC_MMC_TIRQS)
|
||||
#define bfin_write_EMAC_MMC_TIRQS(val) bfin_write32(EMAC_MMC_TIRQS,val)
|
||||
#define bfin_read_EMAC_MMC_TIRQE() bfin_read32(EMAC_MMC_TIRQE)
|
||||
#define bfin_write_EMAC_MMC_TIRQE(val) bfin_write32(EMAC_MMC_TIRQE,val)
|
||||
|
||||
#define bfin_read_EMAC_RXC_OK() bfin_read32(EMAC_RXC_OK)
|
||||
#define bfin_write_EMAC_RXC_OK(val) bfin_write32(EMAC_RXC_OK,val)
|
||||
#define bfin_read_EMAC_RXC_FCS() bfin_read32(EMAC_RXC_FCS)
|
||||
#define bfin_write_EMAC_RXC_FCS(val) bfin_write32(EMAC_RXC_FCS,val)
|
||||
#define bfin_read_EMAC_RXC_ALIGN() bfin_read32(EMAC_RXC_ALIGN)
|
||||
#define bfin_write_EMAC_RXC_ALIGN(val) bfin_write32(EMAC_RXC_ALIGN,val)
|
||||
#define bfin_read_EMAC_RXC_OCTET() bfin_read32(EMAC_RXC_OCTET)
|
||||
#define bfin_write_EMAC_RXC_OCTET(val) bfin_write32(EMAC_RXC_OCTET,val)
|
||||
#define bfin_read_EMAC_RXC_DMAOVF() bfin_read32(EMAC_RXC_DMAOVF)
|
||||
#define bfin_write_EMAC_RXC_DMAOVF(val) bfin_write32(EMAC_RXC_DMAOVF,val)
|
||||
#define bfin_read_EMAC_RXC_UNICST() bfin_read32(EMAC_RXC_UNICST)
|
||||
#define bfin_write_EMAC_RXC_UNICST(val) bfin_write32(EMAC_RXC_UNICST,val)
|
||||
#define bfin_read_EMAC_RXC_MULTI() bfin_read32(EMAC_RXC_MULTI)
|
||||
#define bfin_write_EMAC_RXC_MULTI(val) bfin_write32(EMAC_RXC_MULTI,val)
|
||||
#define bfin_read_EMAC_RXC_BROAD() bfin_read32(EMAC_RXC_BROAD)
|
||||
#define bfin_write_EMAC_RXC_BROAD(val) bfin_write32(EMAC_RXC_BROAD,val)
|
||||
#define bfin_read_EMAC_RXC_LNERRI() bfin_read32(EMAC_RXC_LNERRI)
|
||||
#define bfin_write_EMAC_RXC_LNERRI(val) bfin_write32(EMAC_RXC_LNERRI,val)
|
||||
#define bfin_read_EMAC_RXC_LNERRO() bfin_read32(EMAC_RXC_LNERRO)
|
||||
#define bfin_write_EMAC_RXC_LNERRO(val) bfin_write32(EMAC_RXC_LNERRO,val)
|
||||
#define bfin_read_EMAC_RXC_LONG() bfin_read32(EMAC_RXC_LONG)
|
||||
#define bfin_write_EMAC_RXC_LONG(val) bfin_write32(EMAC_RXC_LONG,val)
|
||||
#define bfin_read_EMAC_RXC_MACCTL() bfin_read32(EMAC_RXC_MACCTL)
|
||||
#define bfin_write_EMAC_RXC_MACCTL(val) bfin_write32(EMAC_RXC_MACCTL,val)
|
||||
#define bfin_read_EMAC_RXC_OPCODE() bfin_read32(EMAC_RXC_OPCODE)
|
||||
#define bfin_write_EMAC_RXC_OPCODE(val) bfin_write32(EMAC_RXC_OPCODE,val)
|
||||
#define bfin_read_EMAC_RXC_PAUSE() bfin_read32(EMAC_RXC_PAUSE)
|
||||
#define bfin_write_EMAC_RXC_PAUSE(val) bfin_write32(EMAC_RXC_PAUSE,val)
|
||||
#define bfin_read_EMAC_RXC_ALLFRM() bfin_read32(EMAC_RXC_ALLFRM)
|
||||
#define bfin_write_EMAC_RXC_ALLFRM(val) bfin_write32(EMAC_RXC_ALLFRM,val)
|
||||
#define bfin_read_EMAC_RXC_ALLOCT() bfin_read32(EMAC_RXC_ALLOCT)
|
||||
#define bfin_write_EMAC_RXC_ALLOCT(val) bfin_write32(EMAC_RXC_ALLOCT,val)
|
||||
#define bfin_read_EMAC_RXC_TYPED() bfin_read32(EMAC_RXC_TYPED)
|
||||
#define bfin_write_EMAC_RXC_TYPED(val) bfin_write32(EMAC_RXC_TYPED,val)
|
||||
#define bfin_read_EMAC_RXC_SHORT() bfin_read32(EMAC_RXC_SHORT)
|
||||
#define bfin_write_EMAC_RXC_SHORT(val) bfin_write32(EMAC_RXC_SHORT,val)
|
||||
#define bfin_read_EMAC_RXC_EQ64() bfin_read32(EMAC_RXC_EQ64)
|
||||
#define bfin_write_EMAC_RXC_EQ64(val) bfin_write32(EMAC_RXC_EQ64,val)
|
||||
#define bfin_read_EMAC_RXC_LT128() bfin_read32(EMAC_RXC_LT128)
|
||||
#define bfin_write_EMAC_RXC_LT128(val) bfin_write32(EMAC_RXC_LT128,val)
|
||||
#define bfin_read_EMAC_RXC_LT256() bfin_read32(EMAC_RXC_LT256)
|
||||
#define bfin_write_EMAC_RXC_LT256(val) bfin_write32(EMAC_RXC_LT256,val)
|
||||
#define bfin_read_EMAC_RXC_LT512() bfin_read32(EMAC_RXC_LT512)
|
||||
#define bfin_write_EMAC_RXC_LT512(val) bfin_write32(EMAC_RXC_LT512,val)
|
||||
#define bfin_read_EMAC_RXC_LT1024() bfin_read32(EMAC_RXC_LT1024)
|
||||
#define bfin_write_EMAC_RXC_LT1024(val) bfin_write32(EMAC_RXC_LT1024,val)
|
||||
#define bfin_read_EMAC_RXC_GE1024() bfin_read32(EMAC_RXC_GE1024)
|
||||
#define bfin_write_EMAC_RXC_GE1024(val) bfin_write32(EMAC_RXC_GE1024,val)
|
||||
|
||||
#define bfin_read_EMAC_TXC_OK() bfin_read32(EMAC_TXC_OK)
|
||||
#define bfin_write_EMAC_TXC_OK(val) bfin_write32(EMAC_TXC_OK,val)
|
||||
#define bfin_read_EMAC_TXC_1COL() bfin_read32(EMAC_TXC_1COL)
|
||||
#define bfin_write_EMAC_TXC_1COL(val) bfin_write32(EMAC_TXC_1COL,val)
|
||||
#define bfin_read_EMAC_TXC_GT1COL() bfin_read32(EMAC_TXC_GT1COL)
|
||||
#define bfin_write_EMAC_TXC_GT1COL(val) bfin_write32(EMAC_TXC_GT1COL,val)
|
||||
#define bfin_read_EMAC_TXC_OCTET() bfin_read32(EMAC_TXC_OCTET)
|
||||
#define bfin_write_EMAC_TXC_OCTET(val) bfin_write32(EMAC_TXC_OCTET,val)
|
||||
#define bfin_read_EMAC_TXC_DEFER() bfin_read32(EMAC_TXC_DEFER)
|
||||
#define bfin_write_EMAC_TXC_DEFER(val) bfin_write32(EMAC_TXC_DEFER,val)
|
||||
#define bfin_read_EMAC_TXC_LATECL() bfin_read32(EMAC_TXC_LATECL)
|
||||
#define bfin_write_EMAC_TXC_LATECL(val) bfin_write32(EMAC_TXC_LATECL,val)
|
||||
#define bfin_read_EMAC_TXC_XS_COL() bfin_read32(EMAC_TXC_XS_COL)
|
||||
#define bfin_write_EMAC_TXC_XS_COL(val) bfin_write32(EMAC_TXC_XS_COL,val)
|
||||
#define bfin_read_EMAC_TXC_DMAUND() bfin_read32(EMAC_TXC_DMAUND)
|
||||
#define bfin_write_EMAC_TXC_DMAUND(val) bfin_write32(EMAC_TXC_DMAUND,val)
|
||||
#define bfin_read_EMAC_TXC_CRSERR() bfin_read32(EMAC_TXC_CRSERR)
|
||||
#define bfin_write_EMAC_TXC_CRSERR(val) bfin_write32(EMAC_TXC_CRSERR,val)
|
||||
#define bfin_read_EMAC_TXC_UNICST() bfin_read32(EMAC_TXC_UNICST)
|
||||
#define bfin_write_EMAC_TXC_UNICST(val) bfin_write32(EMAC_TXC_UNICST,val)
|
||||
#define bfin_read_EMAC_TXC_MULTI() bfin_read32(EMAC_TXC_MULTI)
|
||||
#define bfin_write_EMAC_TXC_MULTI(val) bfin_write32(EMAC_TXC_MULTI,val)
|
||||
#define bfin_read_EMAC_TXC_BROAD() bfin_read32(EMAC_TXC_BROAD)
|
||||
#define bfin_write_EMAC_TXC_BROAD(val) bfin_write32(EMAC_TXC_BROAD,val)
|
||||
#define bfin_read_EMAC_TXC_XS_DFR() bfin_read32(EMAC_TXC_XS_DFR)
|
||||
#define bfin_write_EMAC_TXC_XS_DFR(val) bfin_write32(EMAC_TXC_XS_DFR,val)
|
||||
#define bfin_read_EMAC_TXC_MACCTL() bfin_read32(EMAC_TXC_MACCTL)
|
||||
#define bfin_write_EMAC_TXC_MACCTL(val) bfin_write32(EMAC_TXC_MACCTL,val)
|
||||
#define bfin_read_EMAC_TXC_ALLFRM() bfin_read32(EMAC_TXC_ALLFRM)
|
||||
#define bfin_write_EMAC_TXC_ALLFRM(val) bfin_write32(EMAC_TXC_ALLFRM,val)
|
||||
#define bfin_read_EMAC_TXC_ALLOCT() bfin_read32(EMAC_TXC_ALLOCT)
|
||||
#define bfin_write_EMAC_TXC_ALLOCT(val) bfin_write32(EMAC_TXC_ALLOCT,val)
|
||||
#define bfin_read_EMAC_TXC_EQ64() bfin_read32(EMAC_TXC_EQ64)
|
||||
#define bfin_write_EMAC_TXC_EQ64(val) bfin_write32(EMAC_TXC_EQ64,val)
|
||||
#define bfin_read_EMAC_TXC_LT128() bfin_read32(EMAC_TXC_LT128)
|
||||
#define bfin_write_EMAC_TXC_LT128(val) bfin_write32(EMAC_TXC_LT128,val)
|
||||
#define bfin_read_EMAC_TXC_LT256() bfin_read32(EMAC_TXC_LT256)
|
||||
#define bfin_write_EMAC_TXC_LT256(val) bfin_write32(EMAC_TXC_LT256,val)
|
||||
#define bfin_read_EMAC_TXC_LT512() bfin_read32(EMAC_TXC_LT512)
|
||||
#define bfin_write_EMAC_TXC_LT512(val) bfin_write32(EMAC_TXC_LT512,val)
|
||||
#define bfin_read_EMAC_TXC_LT1024() bfin_read32(EMAC_TXC_LT1024)
|
||||
#define bfin_write_EMAC_TXC_LT1024(val) bfin_write32(EMAC_TXC_LT1024,val)
|
||||
#define bfin_read_EMAC_TXC_GE1024() bfin_read32(EMAC_TXC_GE1024)
|
||||
#define bfin_write_EMAC_TXC_GE1024(val) bfin_write32(EMAC_TXC_GE1024,val)
|
||||
#define bfin_read_EMAC_TXC_ABORT() bfin_read32(EMAC_TXC_ABORT)
|
||||
#define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT,val)
|
||||
|
||||
#endif /* _CDEF_BF537_H */
|
1470
arch/blackfin/mach-bf537/include/mach/defBF534.h
Normal file
1470
arch/blackfin/mach-bf537/include/mach/defBF534.h
Normal file
File diff suppressed because it is too large
Load diff
377
arch/blackfin/mach-bf537/include/mach/defBF537.h
Normal file
377
arch/blackfin/mach-bf537/include/mach/defBF537.h
Normal file
|
@ -0,0 +1,377 @@
|
|||
/*
|
||||
* Copyright 2005-2010 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the Clear BSD license or the GPL-2 (or later)
|
||||
*/
|
||||
|
||||
#ifndef _DEF_BF537_H
|
||||
#define _DEF_BF537_H
|
||||
|
||||
/* Include all MMR and bit defines common to BF534 */
|
||||
#include "defBF534.h"
|
||||
|
||||
/************************************************************************************
|
||||
** Define EMAC Section Unique to BF536/BF537
|
||||
*************************************************************************************/
|
||||
|
||||
/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
|
||||
#define EMAC_OPMODE 0xFFC03000 /* Operating Mode Register */
|
||||
#define EMAC_ADDRLO 0xFFC03004 /* Address Low (32 LSBs) Register */
|
||||
#define EMAC_ADDRHI 0xFFC03008 /* Address High (16 MSBs) Register */
|
||||
#define EMAC_HASHLO 0xFFC0300C /* Multicast Hash Table Low (Bins 31-0) Register */
|
||||
#define EMAC_HASHHI 0xFFC03010 /* Multicast Hash Table High (Bins 63-32) Register */
|
||||
#define EMAC_STAADD 0xFFC03014 /* Station Management Address Register */
|
||||
#define EMAC_STADAT 0xFFC03018 /* Station Management Data Register */
|
||||
#define EMAC_FLC 0xFFC0301C /* Flow Control Register */
|
||||
#define EMAC_VLAN1 0xFFC03020 /* VLAN1 Tag Register */
|
||||
#define EMAC_VLAN2 0xFFC03024 /* VLAN2 Tag Register */
|
||||
#define EMAC_WKUP_CTL 0xFFC0302C /* Wake-Up Control/Status Register */
|
||||
#define EMAC_WKUP_FFMSK0 0xFFC03030 /* Wake-Up Frame Filter 0 Byte Mask Register */
|
||||
#define EMAC_WKUP_FFMSK1 0xFFC03034 /* Wake-Up Frame Filter 1 Byte Mask Register */
|
||||
#define EMAC_WKUP_FFMSK2 0xFFC03038 /* Wake-Up Frame Filter 2 Byte Mask Register */
|
||||
#define EMAC_WKUP_FFMSK3 0xFFC0303C /* Wake-Up Frame Filter 3 Byte Mask Register */
|
||||
#define EMAC_WKUP_FFCMD 0xFFC03040 /* Wake-Up Frame Filter Commands Register */
|
||||
#define EMAC_WKUP_FFOFF 0xFFC03044 /* Wake-Up Frame Filter Offsets Register */
|
||||
#define EMAC_WKUP_FFCRC0 0xFFC03048 /* Wake-Up Frame Filter 0,1 CRC-16 Register */
|
||||
#define EMAC_WKUP_FFCRC1 0xFFC0304C /* Wake-Up Frame Filter 2,3 CRC-16 Register */
|
||||
|
||||
#define EMAC_SYSCTL 0xFFC03060 /* EMAC System Control Register */
|
||||
#define EMAC_SYSTAT 0xFFC03064 /* EMAC System Status Register */
|
||||
#define EMAC_RX_STAT 0xFFC03068 /* RX Current Frame Status Register */
|
||||
#define EMAC_RX_STKY 0xFFC0306C /* RX Sticky Frame Status Register */
|
||||
#define EMAC_RX_IRQE 0xFFC03070 /* RX Frame Status Interrupt Enables Register */
|
||||
#define EMAC_TX_STAT 0xFFC03074 /* TX Current Frame Status Register */
|
||||
#define EMAC_TX_STKY 0xFFC03078 /* TX Sticky Frame Status Register */
|
||||
#define EMAC_TX_IRQE 0xFFC0307C /* TX Frame Status Interrupt Enables Register */
|
||||
|
||||
#define EMAC_MMC_CTL 0xFFC03080 /* MMC Counter Control Register */
|
||||
#define EMAC_MMC_RIRQS 0xFFC03084 /* MMC RX Interrupt Status Register */
|
||||
#define EMAC_MMC_RIRQE 0xFFC03088 /* MMC RX Interrupt Enables Register */
|
||||
#define EMAC_MMC_TIRQS 0xFFC0308C /* MMC TX Interrupt Status Register */
|
||||
#define EMAC_MMC_TIRQE 0xFFC03090 /* MMC TX Interrupt Enables Register */
|
||||
|
||||
#define EMAC_RXC_OK 0xFFC03100 /* RX Frame Successful Count */
|
||||
#define EMAC_RXC_FCS 0xFFC03104 /* RX Frame FCS Failure Count */
|
||||
#define EMAC_RXC_ALIGN 0xFFC03108 /* RX Alignment Error Count */
|
||||
#define EMAC_RXC_OCTET 0xFFC0310C /* RX Octets Successfully Received Count */
|
||||
#define EMAC_RXC_DMAOVF 0xFFC03110 /* Internal MAC Sublayer Error RX Frame Count */
|
||||
#define EMAC_RXC_UNICST 0xFFC03114 /* Unicast RX Frame Count */
|
||||
#define EMAC_RXC_MULTI 0xFFC03118 /* Multicast RX Frame Count */
|
||||
#define EMAC_RXC_BROAD 0xFFC0311C /* Broadcast RX Frame Count */
|
||||
#define EMAC_RXC_LNERRI 0xFFC03120 /* RX Frame In Range Error Count */
|
||||
#define EMAC_RXC_LNERRO 0xFFC03124 /* RX Frame Out Of Range Error Count */
|
||||
#define EMAC_RXC_LONG 0xFFC03128 /* RX Frame Too Long Count */
|
||||
#define EMAC_RXC_MACCTL 0xFFC0312C /* MAC Control RX Frame Count */
|
||||
#define EMAC_RXC_OPCODE 0xFFC03130 /* Unsupported Op-Code RX Frame Count */
|
||||
#define EMAC_RXC_PAUSE 0xFFC03134 /* MAC Control Pause RX Frame Count */
|
||||
#define EMAC_RXC_ALLFRM 0xFFC03138 /* Overall RX Frame Count */
|
||||
#define EMAC_RXC_ALLOCT 0xFFC0313C /* Overall RX Octet Count */
|
||||
#define EMAC_RXC_TYPED 0xFFC03140 /* Type/Length Consistent RX Frame Count */
|
||||
#define EMAC_RXC_SHORT 0xFFC03144 /* RX Frame Fragment Count - Byte Count x < 64 */
|
||||
#define EMAC_RXC_EQ64 0xFFC03148 /* Good RX Frame Count - Byte Count x = 64 */
|
||||
#define EMAC_RXC_LT128 0xFFC0314C /* Good RX Frame Count - Byte Count 64 <= x < 128 */
|
||||
#define EMAC_RXC_LT256 0xFFC03150 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
|
||||
#define EMAC_RXC_LT512 0xFFC03154 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
|
||||
#define EMAC_RXC_LT1024 0xFFC03158 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
|
||||
#define EMAC_RXC_GE1024 0xFFC0315C /* Good RX Frame Count - Byte Count x >= 1024 */
|
||||
|
||||
#define EMAC_TXC_OK 0xFFC03180 /* TX Frame Successful Count */
|
||||
#define EMAC_TXC_1COL 0xFFC03184 /* TX Frames Successful After Single Collision Count */
|
||||
#define EMAC_TXC_GT1COL 0xFFC03188 /* TX Frames Successful After Multiple Collisions Count */
|
||||
#define EMAC_TXC_OCTET 0xFFC0318C /* TX Octets Successfully Received Count */
|
||||
#define EMAC_TXC_DEFER 0xFFC03190 /* TX Frame Delayed Due To Busy Count */
|
||||
#define EMAC_TXC_LATECL 0xFFC03194 /* Late TX Collisions Count */
|
||||
#define EMAC_TXC_XS_COL 0xFFC03198 /* TX Frame Failed Due To Excessive Collisions Count */
|
||||
#define EMAC_TXC_DMAUND 0xFFC0319C /* Internal MAC Sublayer Error TX Frame Count */
|
||||
#define EMAC_TXC_CRSERR 0xFFC031A0 /* Carrier Sense Deasserted During TX Frame Count */
|
||||
#define EMAC_TXC_UNICST 0xFFC031A4 /* Unicast TX Frame Count */
|
||||
#define EMAC_TXC_MULTI 0xFFC031A8 /* Multicast TX Frame Count */
|
||||
#define EMAC_TXC_BROAD 0xFFC031AC /* Broadcast TX Frame Count */
|
||||
#define EMAC_TXC_XS_DFR 0xFFC031B0 /* TX Frames With Excessive Deferral Count */
|
||||
#define EMAC_TXC_MACCTL 0xFFC031B4 /* MAC Control TX Frame Count */
|
||||
#define EMAC_TXC_ALLFRM 0xFFC031B8 /* Overall TX Frame Count */
|
||||
#define EMAC_TXC_ALLOCT 0xFFC031BC /* Overall TX Octet Count */
|
||||
#define EMAC_TXC_EQ64 0xFFC031C0 /* Good TX Frame Count - Byte Count x = 64 */
|
||||
#define EMAC_TXC_LT128 0xFFC031C4 /* Good TX Frame Count - Byte Count 64 <= x < 128 */
|
||||
#define EMAC_TXC_LT256 0xFFC031C8 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
|
||||
#define EMAC_TXC_LT512 0xFFC031CC /* Good TX Frame Count - Byte Count 256 <= x < 512 */
|
||||
#define EMAC_TXC_LT1024 0xFFC031D0 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
|
||||
#define EMAC_TXC_GE1024 0xFFC031D4 /* Good TX Frame Count - Byte Count x >= 1024 */
|
||||
#define EMAC_TXC_ABORT 0xFFC031D8 /* Total TX Frames Aborted Count */
|
||||
|
||||
/* Listing for IEEE-Supported Count Registers */
|
||||
#define FramesReceivedOK EMAC_RXC_OK /* RX Frame Successful Count */
|
||||
#define FrameCheckSequenceErrors EMAC_RXC_FCS /* RX Frame FCS Failure Count */
|
||||
#define AlignmentErrors EMAC_RXC_ALIGN /* RX Alignment Error Count */
|
||||
#define OctetsReceivedOK EMAC_RXC_OCTET /* RX Octets Successfully Received Count */
|
||||
#define FramesLostDueToIntMACRcvError EMAC_RXC_DMAOVF /* Internal MAC Sublayer Error RX Frame Count */
|
||||
#define UnicastFramesReceivedOK EMAC_RXC_UNICST /* Unicast RX Frame Count */
|
||||
#define MulticastFramesReceivedOK EMAC_RXC_MULTI /* Multicast RX Frame Count */
|
||||
#define BroadcastFramesReceivedOK EMAC_RXC_BROAD /* Broadcast RX Frame Count */
|
||||
#define InRangeLengthErrors EMAC_RXC_LNERRI /* RX Frame In Range Error Count */
|
||||
#define OutOfRangeLengthField EMAC_RXC_LNERRO /* RX Frame Out Of Range Error Count */
|
||||
#define FrameTooLongErrors EMAC_RXC_LONG /* RX Frame Too Long Count */
|
||||
#define MACControlFramesReceived EMAC_RXC_MACCTL /* MAC Control RX Frame Count */
|
||||
#define UnsupportedOpcodesReceived EMAC_RXC_OPCODE /* Unsupported Op-Code RX Frame Count */
|
||||
#define PAUSEMACCtrlFramesReceived EMAC_RXC_PAUSE /* MAC Control Pause RX Frame Count */
|
||||
#define FramesReceivedAll EMAC_RXC_ALLFRM /* Overall RX Frame Count */
|
||||
#define OctetsReceivedAll EMAC_RXC_ALLOCT /* Overall RX Octet Count */
|
||||
#define TypedFramesReceived EMAC_RXC_TYPED /* Type/Length Consistent RX Frame Count */
|
||||
#define FramesLenLt64Received EMAC_RXC_SHORT /* RX Frame Fragment Count - Byte Count x < 64 */
|
||||
#define FramesLenEq64Received EMAC_RXC_EQ64 /* Good RX Frame Count - Byte Count x = 64 */
|
||||
#define FramesLen65_127Received EMAC_RXC_LT128 /* Good RX Frame Count - Byte Count 64 <= x < 128 */
|
||||
#define FramesLen128_255Received EMAC_RXC_LT256 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
|
||||
#define FramesLen256_511Received EMAC_RXC_LT512 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
|
||||
#define FramesLen512_1023Received EMAC_RXC_LT1024 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
|
||||
#define FramesLen1024_MaxReceived EMAC_RXC_GE1024 /* Good RX Frame Count - Byte Count x >= 1024 */
|
||||
|
||||
#define FramesTransmittedOK EMAC_TXC_OK /* TX Frame Successful Count */
|
||||
#define SingleCollisionFrames EMAC_TXC_1COL /* TX Frames Successful After Single Collision Count */
|
||||
#define MultipleCollisionFrames EMAC_TXC_GT1COL /* TX Frames Successful After Multiple Collisions Count */
|
||||
#define OctetsTransmittedOK EMAC_TXC_OCTET /* TX Octets Successfully Received Count */
|
||||
#define FramesWithDeferredXmissions EMAC_TXC_DEFER /* TX Frame Delayed Due To Busy Count */
|
||||
#define LateCollisions EMAC_TXC_LATECL /* Late TX Collisions Count */
|
||||
#define FramesAbortedDueToXSColls EMAC_TXC_XS_COL /* TX Frame Failed Due To Excessive Collisions Count */
|
||||
#define FramesLostDueToIntMacXmitError EMAC_TXC_DMAUND /* Internal MAC Sublayer Error TX Frame Count */
|
||||
#define CarrierSenseErrors EMAC_TXC_CRSERR /* Carrier Sense Deasserted During TX Frame Count */
|
||||
#define UnicastFramesXmittedOK EMAC_TXC_UNICST /* Unicast TX Frame Count */
|
||||
#define MulticastFramesXmittedOK EMAC_TXC_MULTI /* Multicast TX Frame Count */
|
||||
#define BroadcastFramesXmittedOK EMAC_TXC_BROAD /* Broadcast TX Frame Count */
|
||||
#define FramesWithExcessiveDeferral EMAC_TXC_XS_DFR /* TX Frames With Excessive Deferral Count */
|
||||
#define MACControlFramesTransmitted EMAC_TXC_MACCTL /* MAC Control TX Frame Count */
|
||||
#define FramesTransmittedAll EMAC_TXC_ALLFRM /* Overall TX Frame Count */
|
||||
#define OctetsTransmittedAll EMAC_TXC_ALLOCT /* Overall TX Octet Count */
|
||||
#define FramesLenEq64Transmitted EMAC_TXC_EQ64 /* Good TX Frame Count - Byte Count x = 64 */
|
||||
#define FramesLen65_127Transmitted EMAC_TXC_LT128 /* Good TX Frame Count - Byte Count 64 <= x < 128 */
|
||||
#define FramesLen128_255Transmitted EMAC_TXC_LT256 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
|
||||
#define FramesLen256_511Transmitted EMAC_TXC_LT512 /* Good TX Frame Count - Byte Count 256 <= x < 512 */
|
||||
#define FramesLen512_1023Transmitted EMAC_TXC_LT1024 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
|
||||
#define FramesLen1024_MaxTransmitted EMAC_TXC_GE1024 /* Good TX Frame Count - Byte Count x >= 1024 */
|
||||
#define TxAbortedFrames EMAC_TXC_ABORT /* Total TX Frames Aborted Count */
|
||||
|
||||
/***********************************************************************************
|
||||
** System MMR Register Bits And Macros
|
||||
**
|
||||
** Disclaimer: All macros are intended to make C and Assembly code more readable.
|
||||
** Use these macros carefully, as any that do left shifts for field
|
||||
** depositing will result in the lower order bits being destroyed. Any
|
||||
** macro that shifts left to properly position the bit-field should be
|
||||
** used as part of an OR to initialize a register and NOT as a dynamic
|
||||
** modifier UNLESS the lower order bits are saved and ORed back in when
|
||||
** the macro is used.
|
||||
*************************************************************************************/
|
||||
/************************ ETHERNET 10/100 CONTROLLER MASKS ************************/
|
||||
/* EMAC_OPMODE Masks */
|
||||
#define RE 0x00000001 /* Receiver Enable */
|
||||
#define ASTP 0x00000002 /* Enable Automatic Pad Stripping On RX Frames */
|
||||
#define HU 0x00000010 /* Hash Filter Unicast Address */
|
||||
#define HM 0x00000020 /* Hash Filter Multicast Address */
|
||||
#define PAM 0x00000040 /* Pass-All-Multicast Mode Enable */
|
||||
#define PR 0x00000080 /* Promiscuous Mode Enable */
|
||||
#define IFE 0x00000100 /* Inverse Filtering Enable */
|
||||
#define DBF 0x00000200 /* Disable Broadcast Frame Reception */
|
||||
#define PBF 0x00000400 /* Pass Bad Frames Enable */
|
||||
#define PSF 0x00000800 /* Pass Short Frames Enable */
|
||||
#define RAF 0x00001000 /* Receive-All Mode */
|
||||
#define TE 0x00010000 /* Transmitter Enable */
|
||||
#define DTXPAD 0x00020000 /* Disable Automatic TX Padding */
|
||||
#define DTXCRC 0x00040000 /* Disable Automatic TX CRC Generation */
|
||||
#define DC 0x00080000 /* Deferral Check */
|
||||
#define BOLMT 0x00300000 /* Back-Off Limit */
|
||||
#define BOLMT_10 0x00000000 /* 10-bit range */
|
||||
#define BOLMT_8 0x00100000 /* 8-bit range */
|
||||
#define BOLMT_4 0x00200000 /* 4-bit range */
|
||||
#define BOLMT_1 0x00300000 /* 1-bit range */
|
||||
#define DRTY 0x00400000 /* Disable TX Retry On Collision */
|
||||
#define LCTRE 0x00800000 /* Enable TX Retry On Late Collision */
|
||||
#define RMII 0x01000000 /* RMII/MII* Mode */
|
||||
#define RMII_10 0x02000000 /* Speed Select for RMII Port (10MBit/100MBit*) */
|
||||
#define FDMODE 0x04000000 /* Duplex Mode Enable (Full/Half*) */
|
||||
#define LB 0x08000000 /* Internal Loopback Enable */
|
||||
#define DRO 0x10000000 /* Disable Receive Own Frames (Half-Duplex Mode) */
|
||||
|
||||
/* EMAC_STAADD Masks */
|
||||
#define STABUSY 0x00000001 /* Initiate Station Mgt Reg Access / STA Busy Stat */
|
||||
#define STAOP 0x00000002 /* Station Management Operation Code (Write/Read*) */
|
||||
#define STADISPRE 0x00000004 /* Disable Preamble Generation */
|
||||
#define STAIE 0x00000008 /* Station Mgt. Transfer Done Interrupt Enable */
|
||||
#define REGAD 0x000007C0 /* STA Register Address */
|
||||
#define PHYAD 0x0000F800 /* PHY Device Address */
|
||||
|
||||
#define SET_REGAD(x) (((x)&0x1F)<< 6 ) /* Set STA Register Address */
|
||||
#define SET_PHYAD(x) (((x)&0x1F)<< 11 ) /* Set PHY Device Address */
|
||||
|
||||
/* EMAC_STADAT Mask */
|
||||
#define STADATA 0x0000FFFF /* Station Management Data */
|
||||
|
||||
/* EMAC_FLC Masks */
|
||||
#define FLCBUSY 0x00000001 /* Send Flow Ctrl Frame / Flow Ctrl Busy Status */
|
||||
#define FLCE 0x00000002 /* Flow Control Enable */
|
||||
#define PCF 0x00000004 /* Pass Control Frames */
|
||||
#define BKPRSEN 0x00000008 /* Enable Backpressure */
|
||||
#define FLCPAUSE 0xFFFF0000 /* Pause Time */
|
||||
|
||||
#define SET_FLCPAUSE(x) (((x)&0xFFFF)<< 16) /* Set Pause Time */
|
||||
|
||||
/* EMAC_WKUP_CTL Masks */
|
||||
#define CAPWKFRM 0x00000001 /* Capture Wake-Up Frames */
|
||||
#define MPKE 0x00000002 /* Magic Packet Enable */
|
||||
#define RWKE 0x00000004 /* Remote Wake-Up Frame Enable */
|
||||
#define GUWKE 0x00000008 /* Global Unicast Wake Enable */
|
||||
#define MPKS 0x00000020 /* Magic Packet Received Status */
|
||||
#define RWKS 0x00000F00 /* Wake-Up Frame Received Status, Filters 3:0 */
|
||||
|
||||
/* EMAC_WKUP_FFCMD Masks */
|
||||
#define WF0_E 0x00000001 /* Enable Wake-Up Filter 0 */
|
||||
#define WF0_T 0x00000008 /* Wake-Up Filter 0 Addr Type (Multicast/Unicast*) */
|
||||
#define WF1_E 0x00000100 /* Enable Wake-Up Filter 1 */
|
||||
#define WF1_T 0x00000800 /* Wake-Up Filter 1 Addr Type (Multicast/Unicast*) */
|
||||
#define WF2_E 0x00010000 /* Enable Wake-Up Filter 2 */
|
||||
#define WF2_T 0x00080000 /* Wake-Up Filter 2 Addr Type (Multicast/Unicast*) */
|
||||
#define WF3_E 0x01000000 /* Enable Wake-Up Filter 3 */
|
||||
#define WF3_T 0x08000000 /* Wake-Up Filter 3 Addr Type (Multicast/Unicast*) */
|
||||
|
||||
/* EMAC_WKUP_FFOFF Masks */
|
||||
#define WF0_OFF 0x000000FF /* Wake-Up Filter 0 Pattern Offset */
|
||||
#define WF1_OFF 0x0000FF00 /* Wake-Up Filter 1 Pattern Offset */
|
||||
#define WF2_OFF 0x00FF0000 /* Wake-Up Filter 2 Pattern Offset */
|
||||
#define WF3_OFF 0xFF000000 /* Wake-Up Filter 3 Pattern Offset */
|
||||
|
||||
#define SET_WF0_OFF(x) (((x)&0xFF)<< 0 ) /* Set Wake-Up Filter 0 Byte Offset */
|
||||
#define SET_WF1_OFF(x) (((x)&0xFF)<< 8 ) /* Set Wake-Up Filter 1 Byte Offset */
|
||||
#define SET_WF2_OFF(x) (((x)&0xFF)<< 16 ) /* Set Wake-Up Filter 2 Byte Offset */
|
||||
#define SET_WF3_OFF(x) (((x)&0xFF)<< 24 ) /* Set Wake-Up Filter 3 Byte Offset */
|
||||
/* Set ALL Offsets */
|
||||
#define SET_WF_OFFS(x0,x1,x2,x3) (SET_WF0_OFF((x0))|SET_WF1_OFF((x1))|SET_WF2_OFF((x2))|SET_WF3_OFF((x3)))
|
||||
|
||||
/* EMAC_WKUP_FFCRC0 Masks */
|
||||
#define WF0_CRC 0x0000FFFF /* Wake-Up Filter 0 Pattern CRC */
|
||||
#define WF1_CRC 0xFFFF0000 /* Wake-Up Filter 1 Pattern CRC */
|
||||
|
||||
#define SET_WF0_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 0 Target CRC */
|
||||
#define SET_WF1_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 1 Target CRC */
|
||||
|
||||
/* EMAC_WKUP_FFCRC1 Masks */
|
||||
#define WF2_CRC 0x0000FFFF /* Wake-Up Filter 2 Pattern CRC */
|
||||
#define WF3_CRC 0xFFFF0000 /* Wake-Up Filter 3 Pattern CRC */
|
||||
|
||||
#define SET_WF2_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 2 Target CRC */
|
||||
#define SET_WF3_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 3 Target CRC */
|
||||
|
||||
/* EMAC_SYSCTL Masks */
|
||||
#define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */
|
||||
#define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */
|
||||
#define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */
|
||||
#define TXDWA 0x00000010 /* Transmit Frame DMA Word Alignment (Odd/Even*) */
|
||||
#define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */
|
||||
|
||||
#define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */
|
||||
|
||||
/* EMAC_SYSTAT Masks */
|
||||
#define PHYINT 0x00000001 /* PHY_INT Interrupt Status */
|
||||
#define MMCINT 0x00000002 /* MMC Counter Interrupt Status */
|
||||
#define RXFSINT 0x00000004 /* RX Frame-Status Interrupt Status */
|
||||
#define TXFSINT 0x00000008 /* TX Frame-Status Interrupt Status */
|
||||
#define WAKEDET 0x00000010 /* Wake-Up Detected Status */
|
||||
#define RXDMAERR 0x00000020 /* RX DMA Direction Error Status */
|
||||
#define TXDMAERR 0x00000040 /* TX DMA Direction Error Status */
|
||||
#define STMDONE 0x00000080 /* Station Mgt. Transfer Done Interrupt Status */
|
||||
|
||||
/* EMAC_RX_STAT, EMAC_RX_STKY, and EMAC_RX_IRQE Masks */
|
||||
#define RX_FRLEN 0x000007FF /* Frame Length In Bytes */
|
||||
#define RX_COMP 0x00001000 /* RX Frame Complete */
|
||||
#define RX_OK 0x00002000 /* RX Frame Received With No Errors */
|
||||
#define RX_LONG 0x00004000 /* RX Frame Too Long Error */
|
||||
#define RX_ALIGN 0x00008000 /* RX Frame Alignment Error */
|
||||
#define RX_CRC 0x00010000 /* RX Frame CRC Error */
|
||||
#define RX_LEN 0x00020000 /* RX Frame Length Error */
|
||||
#define RX_FRAG 0x00040000 /* RX Frame Fragment Error */
|
||||
#define RX_ADDR 0x00080000 /* RX Frame Address Filter Failed Error */
|
||||
#define RX_DMAO 0x00100000 /* RX Frame DMA Overrun Error */
|
||||
#define RX_PHY 0x00200000 /* RX Frame PHY Error */
|
||||
#define RX_LATE 0x00400000 /* RX Frame Late Collision Error */
|
||||
#define RX_RANGE 0x00800000 /* RX Frame Length Field Out of Range Error */
|
||||
#define RX_MULTI 0x01000000 /* RX Multicast Frame Indicator */
|
||||
#define RX_BROAD 0x02000000 /* RX Broadcast Frame Indicator */
|
||||
#define RX_CTL 0x04000000 /* RX Control Frame Indicator */
|
||||
#define RX_UCTL 0x08000000 /* Unsupported RX Control Frame Indicator */
|
||||
#define RX_TYPE 0x10000000 /* RX Typed Frame Indicator */
|
||||
#define RX_VLAN1 0x20000000 /* RX VLAN1 Frame Indicator */
|
||||
#define RX_VLAN2 0x40000000 /* RX VLAN2 Frame Indicator */
|
||||
#define RX_ACCEPT 0x80000000 /* RX Frame Accepted Indicator */
|
||||
|
||||
/* EMAC_TX_STAT, EMAC_TX_STKY, and EMAC_TX_IRQE Masks */
|
||||
#define TX_COMP 0x00000001 /* TX Frame Complete */
|
||||
#define TX_OK 0x00000002 /* TX Frame Sent With No Errors */
|
||||
#define TX_ECOLL 0x00000004 /* TX Frame Excessive Collision Error */
|
||||
#define TX_LATE 0x00000008 /* TX Frame Late Collision Error */
|
||||
#define TX_DMAU 0x00000010 /* TX Frame DMA Underrun Error (STAT) */
|
||||
#define TX_MACE 0x00000010 /* Internal MAC Error Detected (STKY and IRQE) */
|
||||
#define TX_EDEFER 0x00000020 /* TX Frame Excessive Deferral Error */
|
||||
#define TX_BROAD 0x00000040 /* TX Broadcast Frame Indicator */
|
||||
#define TX_MULTI 0x00000080 /* TX Multicast Frame Indicator */
|
||||
#define TX_CCNT 0x00000F00 /* TX Frame Collision Count */
|
||||
#define TX_DEFER 0x00001000 /* TX Frame Deferred Indicator */
|
||||
#define TX_CRS 0x00002000 /* TX Frame Carrier Sense Not Asserted Error */
|
||||
#define TX_LOSS 0x00004000 /* TX Frame Carrier Lost During TX Error */
|
||||
#define TX_RETRY 0x00008000 /* TX Frame Successful After Retry */
|
||||
#define TX_FRLEN 0x07FF0000 /* TX Frame Length (Bytes) */
|
||||
|
||||
/* EMAC_MMC_CTL Masks */
|
||||
#define RSTC 0x00000001 /* Reset All Counters */
|
||||
#define CROLL 0x00000002 /* Counter Roll-Over Enable */
|
||||
#define CCOR 0x00000004 /* Counter Clear-On-Read Mode Enable */
|
||||
#define MMCE 0x00000008 /* Enable MMC Counter Operation */
|
||||
|
||||
/* EMAC_MMC_RIRQS and EMAC_MMC_RIRQE Masks */
|
||||
#define RX_OK_CNT 0x00000001 /* RX Frames Received With No Errors */
|
||||
#define RX_FCS_CNT 0x00000002 /* RX Frames W/Frame Check Sequence Errors */
|
||||
#define RX_ALIGN_CNT 0x00000004 /* RX Frames With Alignment Errors */
|
||||
#define RX_OCTET_CNT 0x00000008 /* RX Octets Received OK */
|
||||
#define RX_LOST_CNT 0x00000010 /* RX Frames Lost Due To Internal MAC RX Error */
|
||||
#define RX_UNI_CNT 0x00000020 /* Unicast RX Frames Received OK */
|
||||
#define RX_MULTI_CNT 0x00000040 /* Multicast RX Frames Received OK */
|
||||
#define RX_BROAD_CNT 0x00000080 /* Broadcast RX Frames Received OK */
|
||||
#define RX_IRL_CNT 0x00000100 /* RX Frames With In-Range Length Errors */
|
||||
#define RX_ORL_CNT 0x00000200 /* RX Frames With Out-Of-Range Length Errors */
|
||||
#define RX_LONG_CNT 0x00000400 /* RX Frames With Frame Too Long Errors */
|
||||
#define RX_MACCTL_CNT 0x00000800 /* MAC Control RX Frames Received */
|
||||
#define RX_OPCODE_CTL 0x00001000 /* Unsupported Op-Code RX Frames Received */
|
||||
#define RX_PAUSE_CNT 0x00002000 /* PAUSEMAC Control RX Frames Received */
|
||||
#define RX_ALLF_CNT 0x00004000 /* All RX Frames Received */
|
||||
#define RX_ALLO_CNT 0x00008000 /* All RX Octets Received */
|
||||
#define RX_TYPED_CNT 0x00010000 /* Typed RX Frames Received */
|
||||
#define RX_SHORT_CNT 0x00020000 /* RX Frame Fragments (< 64 Bytes) Received */
|
||||
#define RX_EQ64_CNT 0x00040000 /* 64-Byte RX Frames Received */
|
||||
#define RX_LT128_CNT 0x00080000 /* 65-127-Byte RX Frames Received */
|
||||
#define RX_LT256_CNT 0x00100000 /* 128-255-Byte RX Frames Received */
|
||||
#define RX_LT512_CNT 0x00200000 /* 256-511-Byte RX Frames Received */
|
||||
#define RX_LT1024_CNT 0x00400000 /* 512-1023-Byte RX Frames Received */
|
||||
#define RX_GE1024_CNT 0x00800000 /* 1024-Max-Byte RX Frames Received */
|
||||
|
||||
/* EMAC_MMC_TIRQS and EMAC_MMC_TIRQE Masks */
|
||||
#define TX_OK_CNT 0x00000001 /* TX Frames Sent OK */
|
||||
#define TX_SCOLL_CNT 0x00000002 /* TX Frames With Single Collisions */
|
||||
#define TX_MCOLL_CNT 0x00000004 /* TX Frames With Multiple Collisions */
|
||||
#define TX_OCTET_CNT 0x00000008 /* TX Octets Sent OK */
|
||||
#define TX_DEFER_CNT 0x00000010 /* TX Frames With Deferred Transmission */
|
||||
#define TX_LATE_CNT 0x00000020 /* TX Frames With Late Collisions */
|
||||
#define TX_ABORTC_CNT 0x00000040 /* TX Frames Aborted Due To Excess Collisions */
|
||||
#define TX_LOST_CNT 0x00000080 /* TX Frames Lost Due To Internal MAC TX Error */
|
||||
#define TX_CRS_CNT 0x00000100 /* TX Frames With Carrier Sense Errors */
|
||||
#define TX_UNI_CNT 0x00000200 /* Unicast TX Frames Sent */
|
||||
#define TX_MULTI_CNT 0x00000400 /* Multicast TX Frames Sent */
|
||||
#define TX_BROAD_CNT 0x00000800 /* Broadcast TX Frames Sent */
|
||||
#define TX_EXDEF_CTL 0x00001000 /* TX Frames With Excessive Deferral */
|
||||
#define TX_MACCTL_CNT 0x00002000 /* MAC Control TX Frames Sent */
|
||||
#define TX_ALLF_CNT 0x00004000 /* All TX Frames Sent */
|
||||
#define TX_ALLO_CNT 0x00008000 /* All TX Octets Sent */
|
||||
#define TX_EQ64_CNT 0x00010000 /* 64-Byte TX Frames Sent */
|
||||
#define TX_LT128_CNT 0x00020000 /* 65-127-Byte TX Frames Sent */
|
||||
#define TX_LT256_CNT 0x00040000 /* 128-255-Byte TX Frames Sent */
|
||||
#define TX_LT512_CNT 0x00080000 /* 256-511-Byte TX Frames Sent */
|
||||
#define TX_LT1024_CNT 0x00100000 /* 512-1023-Byte TX Frames Sent */
|
||||
#define TX_GE1024_CNT 0x00200000 /* 1024-Max-Byte TX Frames Sent */
|
||||
#define TX_ABORT_CNT 0x00400000 /* TX Frames Aborted */
|
||||
|
||||
#endif /* _DEF_BF537_H */
|
31
arch/blackfin/mach-bf537/include/mach/dma.h
Normal file
31
arch/blackfin/mach-bf537/include/mach/dma.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* mach/dma.h - arch-specific DMA defines
|
||||
*
|
||||
* Copyright 2004-2008 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef _MACH_DMA_H_
|
||||
#define _MACH_DMA_H_
|
||||
|
||||
#define MAX_DMA_CHANNELS 16
|
||||
|
||||
#define CH_PPI 0
|
||||
#define CH_EMAC_RX 1
|
||||
#define CH_EMAC_TX 2
|
||||
#define CH_SPORT0_RX 3
|
||||
#define CH_SPORT0_TX 4
|
||||
#define CH_SPORT1_RX 5
|
||||
#define CH_SPORT1_TX 6
|
||||
#define CH_SPI 7
|
||||
#define CH_UART0_RX 8
|
||||
#define CH_UART0_TX 9
|
||||
#define CH_UART1_RX 10
|
||||
#define CH_UART1_TX 11
|
||||
|
||||
#define CH_MEM_STREAM0_DEST 12 /* TX */
|
||||
#define CH_MEM_STREAM0_SRC 13 /* RX */
|
||||
#define CH_MEM_STREAM1_DEST 14 /* TX */
|
||||
#define CH_MEM_STREAM1_SRC 15 /* RX */
|
||||
|
||||
#endif
|
69
arch/blackfin/mach-bf537/include/mach/gpio.h
Normal file
69
arch/blackfin/mach-bf537/include/mach/gpio.h
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright (C) 2008 Analog Devices Inc.
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MACH_GPIO_H_
|
||||
#define _MACH_GPIO_H_
|
||||
|
||||
#define MAX_BLACKFIN_GPIOS 48
|
||||
|
||||
#define GPIO_PF0 0
|
||||
#define GPIO_PF1 1
|
||||
#define GPIO_PF2 2
|
||||
#define GPIO_PF3 3
|
||||
#define GPIO_PF4 4
|
||||
#define GPIO_PF5 5
|
||||
#define GPIO_PF6 6
|
||||
#define GPIO_PF7 7
|
||||
#define GPIO_PF8 8
|
||||
#define GPIO_PF9 9
|
||||
#define GPIO_PF10 10
|
||||
#define GPIO_PF11 11
|
||||
#define GPIO_PF12 12
|
||||
#define GPIO_PF13 13
|
||||
#define GPIO_PF14 14
|
||||
#define GPIO_PF15 15
|
||||
#define GPIO_PG0 16
|
||||
#define GPIO_PG1 17
|
||||
#define GPIO_PG2 18
|
||||
#define GPIO_PG3 19
|
||||
#define GPIO_PG4 20
|
||||
#define GPIO_PG5 21
|
||||
#define GPIO_PG6 22
|
||||
#define GPIO_PG7 23
|
||||
#define GPIO_PG8 24
|
||||
#define GPIO_PG9 25
|
||||
#define GPIO_PG10 26
|
||||
#define GPIO_PG11 27
|
||||
#define GPIO_PG12 28
|
||||
#define GPIO_PG13 29
|
||||
#define GPIO_PG14 30
|
||||
#define GPIO_PG15 31
|
||||
#define GPIO_PH0 32
|
||||
#define GPIO_PH1 33
|
||||
#define GPIO_PH2 34
|
||||
#define GPIO_PH3 35
|
||||
#define GPIO_PH4 36
|
||||
#define GPIO_PH5 37
|
||||
#define GPIO_PH6 38
|
||||
#define GPIO_PH7 39
|
||||
#define GPIO_PH8 40
|
||||
#define GPIO_PH9 41
|
||||
#define GPIO_PH10 42
|
||||
#define GPIO_PH11 43
|
||||
#define GPIO_PH12 44
|
||||
#define GPIO_PH13 45
|
||||
#define GPIO_PH14 46
|
||||
#define GPIO_PH15 47
|
||||
|
||||
#define PORT_F GPIO_PF0
|
||||
#define PORT_G GPIO_PG0
|
||||
#define PORT_H GPIO_PH0
|
||||
|
||||
#include <mach-common/ports-f.h>
|
||||
#include <mach-common/ports-g.h>
|
||||
#include <mach-common/ports-h.h>
|
||||
|
||||
#endif /* _MACH_GPIO_H_ */
|
184
arch/blackfin/mach-bf537/include/mach/irq.h
Normal file
184
arch/blackfin/mach-bf537/include/mach/irq.h
Normal file
|
@ -0,0 +1,184 @@
|
|||
/*
|
||||
* Copyright 2005-2008 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later
|
||||
*/
|
||||
|
||||
#ifndef _BF537_IRQ_H_
|
||||
#define _BF537_IRQ_H_
|
||||
|
||||
#include <mach-common/irq.h>
|
||||
|
||||
#define NR_PERI_INTS 32
|
||||
|
||||
#define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */
|
||||
#define IRQ_DMA_ERROR BFIN_IRQ(1) /* DMA Error (general) */
|
||||
#define IRQ_GENERIC_ERROR BFIN_IRQ(2) /* GENERIC Error Interrupt */
|
||||
#define IRQ_RTC BFIN_IRQ(3) /* RTC Interrupt */
|
||||
#define IRQ_PPI BFIN_IRQ(4) /* DMA0 Interrupt (PPI) */
|
||||
#define IRQ_SPORT0_RX BFIN_IRQ(5) /* DMA3 Interrupt (SPORT0 RX) */
|
||||
#define IRQ_SPORT0_TX BFIN_IRQ(6) /* DMA4 Interrupt (SPORT0 TX) */
|
||||
#define IRQ_SPORT1_RX BFIN_IRQ(7) /* DMA5 Interrupt (SPORT1 RX) */
|
||||
#define IRQ_SPORT1_TX BFIN_IRQ(8) /* DMA6 Interrupt (SPORT1 TX) */
|
||||
#define IRQ_TWI BFIN_IRQ(9) /* TWI Interrupt */
|
||||
#define IRQ_SPI BFIN_IRQ(10) /* DMA7 Interrupt (SPI) */
|
||||
#define IRQ_UART0_RX BFIN_IRQ(11) /* DMA8 Interrupt (UART0 RX) */
|
||||
#define IRQ_UART0_TX BFIN_IRQ(12) /* DMA9 Interrupt (UART0 TX) */
|
||||
#define IRQ_UART1_RX BFIN_IRQ(13) /* DMA10 Interrupt (UART1 RX) */
|
||||
#define IRQ_UART1_TX BFIN_IRQ(14) /* DMA11 Interrupt (UART1 TX) */
|
||||
#define IRQ_CAN_RX BFIN_IRQ(15) /* CAN Receive Interrupt */
|
||||
#define IRQ_CAN_TX BFIN_IRQ(16) /* CAN Transmit Interrupt */
|
||||
#define IRQ_PH_INTA_MAC_RX BFIN_IRQ(17) /* Port H Interrupt A & DMA1 Interrupt (Ethernet RX) */
|
||||
#define IRQ_PH_INTB_MAC_TX BFIN_IRQ(18) /* Port H Interrupt B & DMA2 Interrupt (Ethernet TX) */
|
||||
#define IRQ_TIMER0 BFIN_IRQ(19) /* Timer 0 */
|
||||
#define IRQ_TIMER1 BFIN_IRQ(20) /* Timer 1 */
|
||||
#define IRQ_TIMER2 BFIN_IRQ(21) /* Timer 2 */
|
||||
#define IRQ_TIMER3 BFIN_IRQ(22) /* Timer 3 */
|
||||
#define IRQ_TIMER4 BFIN_IRQ(23) /* Timer 4 */
|
||||
#define IRQ_TIMER5 BFIN_IRQ(24) /* Timer 5 */
|
||||
#define IRQ_TIMER6 BFIN_IRQ(25) /* Timer 6 */
|
||||
#define IRQ_TIMER7 BFIN_IRQ(26) /* Timer 7 */
|
||||
#define IRQ_PF_INTA_PG_INTA BFIN_IRQ(27) /* Ports F&G Interrupt A */
|
||||
#define IRQ_PORTG_INTB BFIN_IRQ(28) /* Port G Interrupt B */
|
||||
#define IRQ_MEM_DMA0 BFIN_IRQ(29) /* (Memory DMA Stream 0) */
|
||||
#define IRQ_MEM_DMA1 BFIN_IRQ(30) /* (Memory DMA Stream 1) */
|
||||
#define IRQ_PF_INTB_WATCH BFIN_IRQ(31) /* Watchdog & Port F Interrupt B */
|
||||
|
||||
#define SYS_IRQS 39
|
||||
|
||||
#define IRQ_PPI_ERROR 42 /* PPI Error Interrupt */
|
||||
#define IRQ_CAN_ERROR 43 /* CAN Error Interrupt */
|
||||
#define IRQ_MAC_ERROR 44 /* MAC Status/Error Interrupt */
|
||||
#define IRQ_SPORT0_ERROR 45 /* SPORT0 Error Interrupt */
|
||||
#define IRQ_SPORT1_ERROR 46 /* SPORT1 Error Interrupt */
|
||||
#define IRQ_SPI_ERROR 47 /* SPI Error Interrupt */
|
||||
#define IRQ_UART0_ERROR 48 /* UART Error Interrupt */
|
||||
#define IRQ_UART1_ERROR 49 /* UART Error Interrupt */
|
||||
|
||||
#define IRQ_PF0 50
|
||||
#define IRQ_PF1 51
|
||||
#define IRQ_PF2 52
|
||||
#define IRQ_PF3 53
|
||||
#define IRQ_PF4 54
|
||||
#define IRQ_PF5 55
|
||||
#define IRQ_PF6 56
|
||||
#define IRQ_PF7 57
|
||||
#define IRQ_PF8 58
|
||||
#define IRQ_PF9 59
|
||||
#define IRQ_PF10 60
|
||||
#define IRQ_PF11 61
|
||||
#define IRQ_PF12 62
|
||||
#define IRQ_PF13 63
|
||||
#define IRQ_PF14 64
|
||||
#define IRQ_PF15 65
|
||||
|
||||
#define IRQ_PG0 66
|
||||
#define IRQ_PG1 67
|
||||
#define IRQ_PG2 68
|
||||
#define IRQ_PG3 69
|
||||
#define IRQ_PG4 70
|
||||
#define IRQ_PG5 71
|
||||
#define IRQ_PG6 72
|
||||
#define IRQ_PG7 73
|
||||
#define IRQ_PG8 74
|
||||
#define IRQ_PG9 75
|
||||
#define IRQ_PG10 76
|
||||
#define IRQ_PG11 77
|
||||
#define IRQ_PG12 78
|
||||
#define IRQ_PG13 79
|
||||
#define IRQ_PG14 80
|
||||
#define IRQ_PG15 81
|
||||
|
||||
#define IRQ_PH0 82
|
||||
#define IRQ_PH1 83
|
||||
#define IRQ_PH2 84
|
||||
#define IRQ_PH3 85
|
||||
#define IRQ_PH4 86
|
||||
#define IRQ_PH5 87
|
||||
#define IRQ_PH6 88
|
||||
#define IRQ_PH7 89
|
||||
#define IRQ_PH8 90
|
||||
#define IRQ_PH9 91
|
||||
#define IRQ_PH10 92
|
||||
#define IRQ_PH11 93
|
||||
#define IRQ_PH12 94
|
||||
#define IRQ_PH13 95
|
||||
#define IRQ_PH14 96
|
||||
#define IRQ_PH15 97
|
||||
|
||||
#define GPIO_IRQ_BASE IRQ_PF0
|
||||
|
||||
#define IRQ_MAC_PHYINT 98 /* PHY_INT Interrupt */
|
||||
#define IRQ_MAC_MMCINT 99 /* MMC Counter Interrupt */
|
||||
#define IRQ_MAC_RXFSINT 100 /* RX Frame-Status Interrupt */
|
||||
#define IRQ_MAC_TXFSINT 101 /* TX Frame-Status Interrupt */
|
||||
#define IRQ_MAC_WAKEDET 102 /* Wake-Up Interrupt */
|
||||
#define IRQ_MAC_RXDMAERR 103 /* RX DMA Direction Error Interrupt */
|
||||
#define IRQ_MAC_TXDMAERR 104 /* TX DMA Direction Error Interrupt */
|
||||
#define IRQ_MAC_STMDONE 105 /* Station Mgt. Transfer Done Interrupt */
|
||||
|
||||
#define IRQ_MAC_RX 106 /* DMA1 Interrupt (Ethernet RX) */
|
||||
#define IRQ_PORTH_INTA 107 /* Port H Interrupt A */
|
||||
|
||||
#if 0 /* No Interrupt B support (yet) */
|
||||
#define IRQ_MAC_TX 108 /* DMA2 Interrupt (Ethernet TX) */
|
||||
#define IRQ_PORTH_INTB 109 /* Port H Interrupt B */
|
||||
#else
|
||||
#define IRQ_MAC_TX IRQ_PH_INTB_MAC_TX
|
||||
#endif
|
||||
|
||||
#define IRQ_PORTF_INTA 110 /* Port F Interrupt A */
|
||||
#define IRQ_PORTG_INTA 111 /* Port G Interrupt A */
|
||||
|
||||
#if 0 /* No Interrupt B support (yet) */
|
||||
#define IRQ_WATCH 112 /* Watchdog Timer */
|
||||
#define IRQ_PORTF_INTB 113 /* Port F Interrupt B */
|
||||
#else
|
||||
#define IRQ_WATCH IRQ_PF_INTB_WATCH
|
||||
#endif
|
||||
|
||||
#define NR_MACH_IRQS (113 + 1)
|
||||
|
||||
/* IAR0 BIT FIELDS */
|
||||
#define IRQ_PLL_WAKEUP_POS 0
|
||||
#define IRQ_DMA_ERROR_POS 4
|
||||
#define IRQ_ERROR_POS 8
|
||||
#define IRQ_RTC_POS 12
|
||||
#define IRQ_PPI_POS 16
|
||||
#define IRQ_SPORT0_RX_POS 20
|
||||
#define IRQ_SPORT0_TX_POS 24
|
||||
#define IRQ_SPORT1_RX_POS 28
|
||||
|
||||
/* IAR1 BIT FIELDS */
|
||||
#define IRQ_SPORT1_TX_POS 0
|
||||
#define IRQ_TWI_POS 4
|
||||
#define IRQ_SPI_POS 8
|
||||
#define IRQ_UART0_RX_POS 12
|
||||
#define IRQ_UART0_TX_POS 16
|
||||
#define IRQ_UART1_RX_POS 20
|
||||
#define IRQ_UART1_TX_POS 24
|
||||
#define IRQ_CAN_RX_POS 28
|
||||
|
||||
/* IAR2 BIT FIELDS */
|
||||
#define IRQ_CAN_TX_POS 0
|
||||
#define IRQ_MAC_RX_POS 4
|
||||
#define IRQ_MAC_TX_POS 8
|
||||
#define IRQ_TIMER0_POS 12
|
||||
#define IRQ_TIMER1_POS 16
|
||||
#define IRQ_TIMER2_POS 20
|
||||
#define IRQ_TIMER3_POS 24
|
||||
#define IRQ_TIMER4_POS 28
|
||||
|
||||
/* IAR3 BIT FIELDS */
|
||||
#define IRQ_TIMER5_POS 0
|
||||
#define IRQ_TIMER6_POS 4
|
||||
#define IRQ_TIMER7_POS 8
|
||||
#define IRQ_PROG_INTA_POS 12
|
||||
#define IRQ_PORTG_INTB_POS 16
|
||||
#define IRQ_MEM_DMA0_POS 20
|
||||
#define IRQ_MEM_DMA1_POS 24
|
||||
#define IRQ_WATCH_POS 28
|
||||
|
||||
#define init_mach_irq init_mach_irq
|
||||
|
||||
#endif
|
147
arch/blackfin/mach-bf537/include/mach/mem_map.h
Normal file
147
arch/blackfin/mach-bf537/include/mach/mem_map.h
Normal file
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
* BF537 memory map
|
||||
*
|
||||
* Copyright 2004-2009 Analog Devices Inc.
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef __BFIN_MACH_MEM_MAP_H__
|
||||
#define __BFIN_MACH_MEM_MAP_H__
|
||||
|
||||
#ifndef __BFIN_MEM_MAP_H__
|
||||
# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
|
||||
#endif
|
||||
|
||||
/* Async Memory Banks */
|
||||
#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
|
||||
#define ASYNC_BANK3_SIZE 0x00100000 /* 1M */
|
||||
#define ASYNC_BANK2_BASE 0x20200000 /* Async Bank 2 */
|
||||
#define ASYNC_BANK2_SIZE 0x00100000 /* 1M */
|
||||
#define ASYNC_BANK1_BASE 0x20100000 /* Async Bank 1 */
|
||||
#define ASYNC_BANK1_SIZE 0x00100000 /* 1M */
|
||||
#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
|
||||
#define ASYNC_BANK0_SIZE 0x00100000 /* 1M */
|
||||
|
||||
/* Boot ROM Memory */
|
||||
|
||||
#define BOOT_ROM_START 0xEF000000
|
||||
#define BOOT_ROM_LENGTH 0x800
|
||||
|
||||
/* Level 1 Memory */
|
||||
|
||||
/* Memory Map for ADSP-BF537 processors */
|
||||
|
||||
#ifdef CONFIG_BFIN_ICACHE
|
||||
#define BFIN_ICACHESIZE (16*1024)
|
||||
#else
|
||||
#define BFIN_ICACHESIZE (0*1024)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_BF537
|
||||
#define L1_CODE_START 0xFFA00000
|
||||
#define L1_DATA_A_START 0xFF800000
|
||||
#define L1_DATA_B_START 0xFF900000
|
||||
|
||||
#define L1_CODE_LENGTH 0xC000
|
||||
|
||||
#ifdef CONFIG_BFIN_DCACHE
|
||||
|
||||
#ifdef CONFIG_BFIN_DCACHE_BANKA
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BFIN_DCACHESIZE (16*1024)
|
||||
#define BFIN_DSUPBANKS 1
|
||||
#else
|
||||
#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
|
||||
#define BFIN_DCACHESIZE (32*1024)
|
||||
#define BFIN_DSUPBANKS 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x8000
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BFIN_DCACHESIZE (0*1024)
|
||||
#define BFIN_DSUPBANKS 0
|
||||
#endif /*CONFIG_BFIN_DCACHE*/
|
||||
|
||||
#endif /*CONFIG_BF537*/
|
||||
|
||||
/* Memory Map for ADSP-BF536 processors */
|
||||
|
||||
#ifdef CONFIG_BF536
|
||||
#define L1_CODE_START 0xFFA00000
|
||||
#define L1_DATA_A_START 0xFF804000
|
||||
#define L1_DATA_B_START 0xFF904000
|
||||
|
||||
#define L1_CODE_LENGTH 0xC000
|
||||
|
||||
|
||||
#ifdef CONFIG_BFIN_DCACHE
|
||||
|
||||
#ifdef CONFIG_BFIN_DCACHE_BANKA
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH 0x4000
|
||||
#define BFIN_DCACHESIZE (16*1024)
|
||||
#define BFIN_DSUPBANKS 1
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x4000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH (0x4000 - 0x4000)
|
||||
#define BFIN_DCACHESIZE (32*1024)
|
||||
#define BFIN_DSUPBANKS 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x4000
|
||||
#define L1_DATA_B_LENGTH 0x4000
|
||||
#define BFIN_DCACHESIZE (0*1024)
|
||||
#define BFIN_DSUPBANKS 0
|
||||
#endif /*CONFIG_BFIN_DCACHE*/
|
||||
|
||||
#endif
|
||||
|
||||
/* Memory Map for ADSP-BF534 processors */
|
||||
|
||||
#ifdef CONFIG_BF534
|
||||
#define L1_CODE_START 0xFFA00000
|
||||
#define L1_DATA_A_START 0xFF800000
|
||||
#define L1_DATA_B_START 0xFF900000
|
||||
|
||||
#define L1_CODE_LENGTH 0xC000
|
||||
|
||||
#ifdef CONFIG_BFIN_DCACHE
|
||||
|
||||
#ifdef CONFIG_BFIN_DCACHE_BANKA
|
||||
#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BFIN_DCACHESIZE (16*1024)
|
||||
#define BFIN_DSUPBANKS 1
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
|
||||
#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
|
||||
#define BFIN_DCACHESIZE (32*1024)
|
||||
#define BFIN_DSUPBANKS 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
|
||||
#define L1_DATA_A_LENGTH 0x8000
|
||||
#define L1_DATA_B_LENGTH 0x8000
|
||||
#define BFIN_DCACHESIZE (0*1024)
|
||||
#define BFIN_DSUPBANKS 0
|
||||
#endif /*CONFIG_BFIN_DCACHE*/
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
1
arch/blackfin/mach-bf537/include/mach/pll.h
Normal file
1
arch/blackfin/mach-bf537/include/mach/pll.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <mach-common/pll.h>
|
152
arch/blackfin/mach-bf537/include/mach/portmux.h
Normal file
152
arch/blackfin/mach-bf537/include/mach/portmux.h
Normal file
|
@ -0,0 +1,152 @@
|
|||
/*
|
||||
* Copyright 2007-2009 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later
|
||||
*/
|
||||
|
||||
#ifndef _MACH_PORTMUX_H_
|
||||
#define _MACH_PORTMUX_H_
|
||||
|
||||
#define MAX_RESOURCES (MAX_BLACKFIN_GPIOS + GPIO_BANKSIZE) /* We additionally handle PORTJ */
|
||||
|
||||
#define P_UART0_TX (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(0))
|
||||
#define P_UART0_RX (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(0))
|
||||
#define P_UART1_TX (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(0))
|
||||
#define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(0))
|
||||
#define P_TMR5 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(0))
|
||||
#define P_TMR4 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(0))
|
||||
#define P_TMR3 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(0))
|
||||
#define P_TMR2 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(0))
|
||||
#define P_TMR1 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(0))
|
||||
#define P_TMR0 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(0))
|
||||
#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(0))
|
||||
#define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(0))
|
||||
#define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(0))
|
||||
#define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0))
|
||||
#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0))
|
||||
#define P_PPI0_CLK (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0))
|
||||
#define P_DMAR0 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))
|
||||
#define P_DMAR1 (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))
|
||||
#define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))
|
||||
#define P_TMR6 (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))
|
||||
#define P_SPI0_SSEL6 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))
|
||||
#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))
|
||||
#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))
|
||||
#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))
|
||||
#define P_PPI0_FS2 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1))
|
||||
#define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
|
||||
#define P_TACLK0 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
|
||||
#define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
|
||||
#define GPIO_DEFAULT_BOOT_SPI_CS GPIO_PF10
|
||||
#define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL1
|
||||
|
||||
#define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
|
||||
#define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
|
||||
#define P_PPI0_D2 (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(0))
|
||||
#define P_PPI0_D3 (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0))
|
||||
#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0))
|
||||
#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(0))
|
||||
#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))
|
||||
#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(0))
|
||||
#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(0))
|
||||
#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(0))
|
||||
#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(0))
|
||||
#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(0))
|
||||
#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(0))
|
||||
#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0))
|
||||
#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))
|
||||
#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))
|
||||
#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(1))
|
||||
#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(1))
|
||||
#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(1))
|
||||
#define P_SPORT1_RFS (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(1))
|
||||
#define P_SPORT1_DRPRI (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(1))
|
||||
#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1))
|
||||
#define P_SPORT1_TFS (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(1))
|
||||
#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(1))
|
||||
|
||||
#define P_MII0_ETxD0 (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(0))
|
||||
#define P_MII0_ETxD1 (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(0))
|
||||
#define P_MII0_ETxD2 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(0))
|
||||
#define P_MII0_ETxD3 (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(0))
|
||||
#define P_MII0_ETxEN (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(0))
|
||||
#define P_MII0_TxCLK (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(0))
|
||||
#define P_MII0_PHYINT (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(0))
|
||||
#define P_MII0_COL (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(0))
|
||||
#define P_MII0_ERxD0 (P_DEFINED | P_IDENT(GPIO_PH8) | P_FUNCT(0))
|
||||
#define P_MII0_ERxD1 (P_DEFINED | P_IDENT(GPIO_PH9) | P_FUNCT(0))
|
||||
#define P_MII0_ERxD2 (P_DEFINED | P_IDENT(GPIO_PH10) | P_FUNCT(0))
|
||||
#define P_MII0_ERxD3 (P_DEFINED | P_IDENT(GPIO_PH11) | P_FUNCT(0))
|
||||
#define P_MII0_ERxDV (P_DEFINED | P_IDENT(GPIO_PH12) | P_FUNCT(0))
|
||||
#define P_MII0_ERxCLK (P_DEFINED | P_IDENT(GPIO_PH13) | P_FUNCT(0))
|
||||
#define P_MII0_ERxER (P_DEFINED | P_IDENT(GPIO_PH14) | P_FUNCT(0))
|
||||
#define P_MII0_CRS (P_DEFINED | P_IDENT(GPIO_PH15) | P_FUNCT(0))
|
||||
#define P_RMII0_REF_CLK (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(1))
|
||||
#define P_RMII0_MDINT (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(1))
|
||||
#define P_RMII0_CRS_DV (P_DEFINED | P_IDENT(GPIO_PH15) | P_FUNCT(1))
|
||||
|
||||
#define PORT_PJ0 (GPIO_PH15 + 1)
|
||||
#define PORT_PJ1 (GPIO_PH15 + 2)
|
||||
#define PORT_PJ2 (GPIO_PH15 + 3)
|
||||
#define PORT_PJ3 (GPIO_PH15 + 4)
|
||||
#define PORT_PJ4 (GPIO_PH15 + 5)
|
||||
#define PORT_PJ5 (GPIO_PH15 + 6)
|
||||
#define PORT_PJ6 (GPIO_PH15 + 7)
|
||||
#define PORT_PJ7 (GPIO_PH15 + 8)
|
||||
#define PORT_PJ8 (GPIO_PH15 + 9)
|
||||
#define PORT_PJ9 (GPIO_PH15 + 10)
|
||||
#define PORT_PJ10 (GPIO_PH15 + 11)
|
||||
#define PORT_PJ11 (GPIO_PH15 + 12)
|
||||
|
||||
#define P_MDC (P_DEFINED | P_IDENT(PORT_PJ0) | P_FUNCT(0))
|
||||
#define P_MDIO (P_DEFINED | P_IDENT(PORT_PJ1) | P_FUNCT(0))
|
||||
#define P_TWI0_SCL (P_DEFINED | P_IDENT(PORT_PJ2) | P_FUNCT(0))
|
||||
#define P_TWI0_SDA (P_DEFINED | P_IDENT(PORT_PJ3) | P_FUNCT(0))
|
||||
#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(PORT_PJ4) | P_FUNCT(0))
|
||||
#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(0))
|
||||
#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(PORT_PJ6) | P_FUNCT(0))
|
||||
#define P_SPORT0_RFS (P_DEFINED | P_IDENT(PORT_PJ7) | P_FUNCT(0))
|
||||
#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(PORT_PJ8) | P_FUNCT(0))
|
||||
#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(PORT_PJ9) | P_FUNCT(0))
|
||||
#define P_SPORT0_TFS (P_DEFINED | P_IDENT(PORT_PJ10) | P_FUNCT(0))
|
||||
#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(0))
|
||||
#define P_CAN0_RX (P_DEFINED | P_IDENT(PORT_PJ4) | P_FUNCT(1))
|
||||
#define P_CAN0_TX (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(1))
|
||||
#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(PORT_PJ10) | P_FUNCT(1))
|
||||
#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1))
|
||||
#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2))
|
||||
|
||||
#define P_MII0 {\
|
||||
P_MII0_ETxD0, \
|
||||
P_MII0_ETxD1, \
|
||||
P_MII0_ETxD2, \
|
||||
P_MII0_ETxD3, \
|
||||
P_MII0_ETxEN, \
|
||||
P_MII0_TxCLK, \
|
||||
P_MII0_PHYINT, \
|
||||
P_MII0_COL, \
|
||||
P_MII0_ERxD0, \
|
||||
P_MII0_ERxD1, \
|
||||
P_MII0_ERxD2, \
|
||||
P_MII0_ERxD3, \
|
||||
P_MII0_ERxDV, \
|
||||
P_MII0_ERxCLK, \
|
||||
P_MII0_ERxER, \
|
||||
P_MII0_CRS, \
|
||||
P_MDC, \
|
||||
P_MDIO, 0}
|
||||
|
||||
#define P_RMII0 {\
|
||||
P_MII0_ETxD0, \
|
||||
P_MII0_ETxD1, \
|
||||
P_MII0_ETxEN, \
|
||||
P_MII0_ERxD0, \
|
||||
P_MII0_ERxD1, \
|
||||
P_MII0_ERxER, \
|
||||
P_RMII0_REF_CLK, \
|
||||
P_RMII0_MDINT, \
|
||||
P_RMII0_CRS_DV, \
|
||||
P_MDC, \
|
||||
P_MDIO, 0}
|
||||
|
||||
#endif /* _MACH_PORTMUX_H_ */
|
216
arch/blackfin/mach-bf537/ints-priority.c
Normal file
216
arch/blackfin/mach-bf537/ints-priority.c
Normal file
|
@ -0,0 +1,216 @@
|
|||
/*
|
||||
* Copyright 2005-2009 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*
|
||||
* Set up the interrupt priorities
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/irq.h>
|
||||
#include <asm/blackfin.h>
|
||||
|
||||
#include <asm/irq_handler.h>
|
||||
#include <asm/bfin5xx_spi.h>
|
||||
#include <asm/bfin_sport.h>
|
||||
#include <asm/bfin_can.h>
|
||||
#include <asm/bfin_dma.h>
|
||||
#include <asm/dpmc.h>
|
||||
|
||||
void __init program_IAR(void)
|
||||
{
|
||||
/* Program the IAR0 Register with the configured priority */
|
||||
bfin_write_SIC_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) |
|
||||
((CONFIG_IRQ_DMA_ERROR - 7) << IRQ_DMA_ERROR_POS) |
|
||||
((CONFIG_IRQ_ERROR - 7) << IRQ_ERROR_POS) |
|
||||
((CONFIG_IRQ_RTC - 7) << IRQ_RTC_POS) |
|
||||
((CONFIG_IRQ_PPI - 7) << IRQ_PPI_POS) |
|
||||
((CONFIG_IRQ_SPORT0_RX - 7) << IRQ_SPORT0_RX_POS) |
|
||||
((CONFIG_IRQ_SPORT0_TX - 7) << IRQ_SPORT0_TX_POS) |
|
||||
((CONFIG_IRQ_SPORT1_RX - 7) << IRQ_SPORT1_RX_POS));
|
||||
|
||||
bfin_write_SIC_IAR1(((CONFIG_IRQ_SPORT1_TX - 7) << IRQ_SPORT1_TX_POS) |
|
||||
((CONFIG_IRQ_TWI - 7) << IRQ_TWI_POS) |
|
||||
((CONFIG_IRQ_SPI - 7) << IRQ_SPI_POS) |
|
||||
((CONFIG_IRQ_UART0_RX - 7) << IRQ_UART0_RX_POS) |
|
||||
((CONFIG_IRQ_UART0_TX - 7) << IRQ_UART0_TX_POS) |
|
||||
((CONFIG_IRQ_UART1_RX - 7) << IRQ_UART1_RX_POS) |
|
||||
((CONFIG_IRQ_UART1_TX - 7) << IRQ_UART1_TX_POS) |
|
||||
((CONFIG_IRQ_CAN_RX - 7) << IRQ_CAN_RX_POS));
|
||||
|
||||
bfin_write_SIC_IAR2(((CONFIG_IRQ_CAN_TX - 7) << IRQ_CAN_TX_POS) |
|
||||
((CONFIG_IRQ_MAC_RX - 7) << IRQ_MAC_RX_POS) |
|
||||
((CONFIG_IRQ_MAC_TX - 7) << IRQ_MAC_TX_POS) |
|
||||
((CONFIG_IRQ_TIMER0 - 7) << IRQ_TIMER0_POS) |
|
||||
((CONFIG_IRQ_TIMER1 - 7) << IRQ_TIMER1_POS) |
|
||||
((CONFIG_IRQ_TIMER2 - 7) << IRQ_TIMER2_POS) |
|
||||
((CONFIG_IRQ_TIMER3 - 7) << IRQ_TIMER3_POS) |
|
||||
((CONFIG_IRQ_TIMER4 - 7) << IRQ_TIMER4_POS));
|
||||
|
||||
bfin_write_SIC_IAR3(((CONFIG_IRQ_TIMER5 - 7) << IRQ_TIMER5_POS) |
|
||||
((CONFIG_IRQ_TIMER6 - 7) << IRQ_TIMER6_POS) |
|
||||
((CONFIG_IRQ_TIMER7 - 7) << IRQ_TIMER7_POS) |
|
||||
((CONFIG_IRQ_PROG_INTA - 7) << IRQ_PROG_INTA_POS) |
|
||||
((CONFIG_IRQ_PORTG_INTB - 7) << IRQ_PORTG_INTB_POS) |
|
||||
((CONFIG_IRQ_MEM_DMA0 - 7) << IRQ_MEM_DMA0_POS) |
|
||||
((CONFIG_IRQ_MEM_DMA1 - 7) << IRQ_MEM_DMA1_POS) |
|
||||
((CONFIG_IRQ_WATCH - 7) << IRQ_WATCH_POS));
|
||||
|
||||
SSYNC();
|
||||
}
|
||||
|
||||
#define SPI_ERR_MASK (BIT_STAT_TXCOL | BIT_STAT_RBSY | BIT_STAT_MODF | BIT_STAT_TXE) /* SPI_STAT */
|
||||
#define SPORT_ERR_MASK (ROVF | RUVF | TOVF | TUVF) /* SPORT_STAT */
|
||||
#define PPI_ERR_MASK (0xFFFF & ~FLD) /* PPI_STATUS */
|
||||
#define EMAC_ERR_MASK (PHYINT | MMCINT | RXFSINT | TXFSINT | WAKEDET | RXDMAERR | TXDMAERR | STMDONE) /* EMAC_SYSTAT */
|
||||
#define UART_ERR_MASK (0x6) /* UART_IIR */
|
||||
#define CAN_ERR_MASK (EWTIF | EWRIF | EPIF | BOIF | WUIF | UIAIF | AAIF | RMLIF | UCEIF | EXTIF | ADIF) /* CAN_GIF */
|
||||
|
||||
static int error_int_mask;
|
||||
|
||||
static void bf537_generic_error_mask_irq(struct irq_data *d)
|
||||
{
|
||||
error_int_mask &= ~(1L << (d->irq - IRQ_PPI_ERROR));
|
||||
if (!error_int_mask)
|
||||
bfin_internal_mask_irq(IRQ_GENERIC_ERROR);
|
||||
}
|
||||
|
||||
static void bf537_generic_error_unmask_irq(struct irq_data *d)
|
||||
{
|
||||
bfin_internal_unmask_irq(IRQ_GENERIC_ERROR);
|
||||
error_int_mask |= 1L << (d->irq - IRQ_PPI_ERROR);
|
||||
}
|
||||
|
||||
static struct irq_chip bf537_generic_error_irqchip = {
|
||||
.name = "ERROR",
|
||||
.irq_ack = bfin_ack_noop,
|
||||
.irq_mask_ack = bf537_generic_error_mask_irq,
|
||||
.irq_mask = bf537_generic_error_mask_irq,
|
||||
.irq_unmask = bf537_generic_error_unmask_irq,
|
||||
};
|
||||
|
||||
static void bf537_demux_error_irq(unsigned int int_err_irq,
|
||||
struct irq_desc *inta_desc)
|
||||
{
|
||||
int irq = 0;
|
||||
|
||||
#if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
|
||||
if (bfin_read_EMAC_SYSTAT() & EMAC_ERR_MASK)
|
||||
irq = IRQ_MAC_ERROR;
|
||||
else
|
||||
#endif
|
||||
if (bfin_read_SPORT0_STAT() & SPORT_ERR_MASK)
|
||||
irq = IRQ_SPORT0_ERROR;
|
||||
else if (bfin_read_SPORT1_STAT() & SPORT_ERR_MASK)
|
||||
irq = IRQ_SPORT1_ERROR;
|
||||
else if (bfin_read_PPI_STATUS() & PPI_ERR_MASK)
|
||||
irq = IRQ_PPI_ERROR;
|
||||
else if (bfin_read_CAN_GIF() & CAN_ERR_MASK)
|
||||
irq = IRQ_CAN_ERROR;
|
||||
else if (bfin_read_SPI_STAT() & SPI_ERR_MASK)
|
||||
irq = IRQ_SPI_ERROR;
|
||||
else if ((bfin_read_UART0_IIR() & UART_ERR_MASK) == UART_ERR_MASK)
|
||||
irq = IRQ_UART0_ERROR;
|
||||
else if ((bfin_read_UART1_IIR() & UART_ERR_MASK) == UART_ERR_MASK)
|
||||
irq = IRQ_UART1_ERROR;
|
||||
|
||||
if (irq) {
|
||||
if (error_int_mask & (1L << (irq - IRQ_PPI_ERROR)))
|
||||
bfin_handle_irq(irq);
|
||||
else {
|
||||
|
||||
switch (irq) {
|
||||
case IRQ_PPI_ERROR:
|
||||
bfin_write_PPI_STATUS(PPI_ERR_MASK);
|
||||
break;
|
||||
#if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
|
||||
case IRQ_MAC_ERROR:
|
||||
bfin_write_EMAC_SYSTAT(EMAC_ERR_MASK);
|
||||
break;
|
||||
#endif
|
||||
case IRQ_SPORT0_ERROR:
|
||||
bfin_write_SPORT0_STAT(SPORT_ERR_MASK);
|
||||
break;
|
||||
|
||||
case IRQ_SPORT1_ERROR:
|
||||
bfin_write_SPORT1_STAT(SPORT_ERR_MASK);
|
||||
break;
|
||||
|
||||
case IRQ_CAN_ERROR:
|
||||
bfin_write_CAN_GIS(CAN_ERR_MASK);
|
||||
break;
|
||||
|
||||
case IRQ_SPI_ERROR:
|
||||
bfin_write_SPI_STAT(SPI_ERR_MASK);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
pr_debug("IRQ %d:"
|
||||
" MASKED PERIPHERAL ERROR INTERRUPT ASSERTED\n",
|
||||
irq);
|
||||
}
|
||||
} else
|
||||
pr_err("%s: IRQ ?: PERIPHERAL ERROR INTERRUPT ASSERTED BUT NO SOURCE FOUND\n",
|
||||
__func__);
|
||||
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
|
||||
static int mac_rx_int_mask;
|
||||
|
||||
static void bf537_mac_rx_mask_irq(struct irq_data *d)
|
||||
{
|
||||
mac_rx_int_mask &= ~(1L << (d->irq - IRQ_MAC_RX));
|
||||
if (!mac_rx_int_mask)
|
||||
bfin_internal_mask_irq(IRQ_PH_INTA_MAC_RX);
|
||||
}
|
||||
|
||||
static void bf537_mac_rx_unmask_irq(struct irq_data *d)
|
||||
{
|
||||
bfin_internal_unmask_irq(IRQ_PH_INTA_MAC_RX);
|
||||
mac_rx_int_mask |= 1L << (d->irq - IRQ_MAC_RX);
|
||||
}
|
||||
|
||||
static struct irq_chip bf537_mac_rx_irqchip = {
|
||||
.name = "ERROR",
|
||||
.irq_ack = bfin_ack_noop,
|
||||
.irq_mask_ack = bf537_mac_rx_mask_irq,
|
||||
.irq_mask = bf537_mac_rx_mask_irq,
|
||||
.irq_unmask = bf537_mac_rx_unmask_irq,
|
||||
};
|
||||
|
||||
static void bf537_demux_mac_rx_irq(unsigned int int_irq,
|
||||
struct irq_desc *desc)
|
||||
{
|
||||
if (bfin_read_DMA1_IRQ_STATUS() & (DMA_DONE | DMA_ERR))
|
||||
bfin_handle_irq(IRQ_MAC_RX);
|
||||
else
|
||||
bfin_demux_gpio_irq(int_irq, desc);
|
||||
}
|
||||
#endif
|
||||
|
||||
void __init init_mach_irq(void)
|
||||
{
|
||||
int irq;
|
||||
|
||||
#if defined(CONFIG_BF537) || defined(CONFIG_BF536)
|
||||
/* Clear EMAC Interrupt Status bits so we can demux it later */
|
||||
bfin_write_EMAC_SYSTAT(-1);
|
||||
#endif
|
||||
|
||||
irq_set_chained_handler(IRQ_GENERIC_ERROR, bf537_demux_error_irq);
|
||||
for (irq = IRQ_PPI_ERROR; irq <= IRQ_UART1_ERROR; irq++)
|
||||
irq_set_chip_and_handler(irq, &bf537_generic_error_irqchip,
|
||||
handle_level_irq);
|
||||
|
||||
#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
|
||||
irq_set_chained_handler(IRQ_PH_INTA_MAC_RX, bf537_demux_mac_rx_irq);
|
||||
irq_set_chip_and_handler(IRQ_MAC_RX, &bf537_mac_rx_irqchip, handle_level_irq);
|
||||
irq_set_chip_and_handler(IRQ_PORTH_INTA, &bf537_mac_rx_irqchip, handle_level_irq);
|
||||
|
||||
irq_set_chained_handler(IRQ_MAC_ERROR, bfin_demux_mac_status_irq);
|
||||
#endif
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue