mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
ARM: davinci: remove unused board support
All Kconfig entries marked as "depends on UNUSED_BOARD_FILES" and their direct dependencies are removed here as planned. Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
+3
-13
@@ -323,14 +323,6 @@ choice
|
||||
Say Y here if you want the debug print routines to direct
|
||||
their output to UART2 serial port on DaVinci DA8XX devices.
|
||||
|
||||
config DEBUG_DAVINCI_DMx_UART0
|
||||
bool "Kernel low-level debugging on DaVinci DMx using UART0"
|
||||
depends on ARCH_DAVINCI_DMx
|
||||
select DEBUG_UART_8250
|
||||
help
|
||||
Say Y here if you want the debug print routines to direct
|
||||
their output to UART0 serial port on DaVinci DMx devices.
|
||||
|
||||
config DEBUG_DC21285_PORT
|
||||
bool "Kernel low-level debugging messages via footbridge serial port"
|
||||
depends on FOOTBRIDGE
|
||||
@@ -1590,7 +1582,6 @@ config DEBUG_UART_8250
|
||||
|
||||
config DEBUG_UART_PHYS
|
||||
hex "Physical base address of debug UART"
|
||||
default 0x01c20000 if DEBUG_DAVINCI_DMx_UART0
|
||||
default 0x01c28000 if DEBUG_SUNXI_UART0
|
||||
default 0x01c28400 if DEBUG_SUNXI_UART1
|
||||
default 0x01d0c000 if DEBUG_DAVINCI_DA8XX_UART1
|
||||
@@ -1810,7 +1801,6 @@ config DEBUG_UART_VIRT
|
||||
default 0xfec03000 if DEBUG_SOCFPGA_CYCLONE5_UART1
|
||||
default 0xfec12000 if DEBUG_MVEBU_UART0 || DEBUG_MVEBU_UART0_ALTERNATE
|
||||
default 0xfec12100 if DEBUG_MVEBU_UART1_ALTERNATE
|
||||
default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0
|
||||
default 0xfec90000 if DEBUG_RK32_UART2
|
||||
default 0xfed0c000 if DEBUG_DAVINCI_DA8XX_UART1
|
||||
default 0xfed0d000 if DEBUG_DAVINCI_DA8XX_UART2 || DEBUG_SD5203_UART
|
||||
@@ -1854,9 +1844,9 @@ config DEBUG_UART_8250_WORD
|
||||
default y if DEBUG_SOCFPGA_UART0 || DEBUG_SOCFPGA_ARRIA10_UART1 || \
|
||||
DEBUG_SOCFPGA_CYCLONE5_UART1 || DEBUG_KEYSTONE_UART0 || \
|
||||
DEBUG_KEYSTONE_UART1 || DEBUG_ALPINE_UART0 || \
|
||||
DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \
|
||||
DEBUG_DAVINCI_DA8XX_UART2 || DEBUG_BCM_IPROC_UART3 || \
|
||||
DEBUG_BCM_KONA_UART || DEBUG_RK32_UART2
|
||||
DEBUG_DAVINCI_DA8XX_UART1 || DEBUG_DAVINCI_DA8XX_UART2 || \
|
||||
DEBUG_BCM_IPROC_UART3 || DEBUG_BCM_KONA_UART || \
|
||||
DEBUG_RK32_UART2
|
||||
|
||||
config DEBUG_UART_8250_PALMCHIP
|
||||
bool "8250 UART is Palmchip BK-310x"
|
||||
|
||||
@@ -14,20 +14,11 @@ menuconfig ARCH_DAVINCI
|
||||
|
||||
if ARCH_DAVINCI
|
||||
|
||||
config ARCH_DAVINCI_DMx
|
||||
bool
|
||||
|
||||
comment "DaVinci Core Type"
|
||||
|
||||
config ARCH_DAVINCI_DM355
|
||||
bool "DaVinci 355 based system"
|
||||
depends on ATAGS && UNUSED_BOARD_FILES
|
||||
select DAVINCI_AINTC
|
||||
select ARCH_DAVINCI_DMx
|
||||
|
||||
config ARCH_DAVINCI_DA830
|
||||
bool "DA830/OMAP-L137/AM17x based system"
|
||||
depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
|
||||
depends on AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT
|
||||
depends on ATAGS
|
||||
select ARCH_DAVINCI_DA8XX
|
||||
# needed on silicon revs 1.0, 1.1:
|
||||
@@ -36,7 +27,7 @@ config ARCH_DAVINCI_DA830
|
||||
|
||||
config ARCH_DAVINCI_DA850
|
||||
bool "DA850/OMAP-L138/AM18x based system"
|
||||
depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
|
||||
depends on AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT
|
||||
depends on ATAGS
|
||||
select ARCH_DAVINCI_DA8XX
|
||||
select DAVINCI_CP_INTC
|
||||
@@ -44,12 +35,6 @@ config ARCH_DAVINCI_DA850
|
||||
config ARCH_DAVINCI_DA8XX
|
||||
bool
|
||||
|
||||
config ARCH_DAVINCI_DM365
|
||||
bool "DaVinci 365 based system"
|
||||
depends on ATAGS && UNUSED_BOARD_FILES
|
||||
select DAVINCI_AINTC
|
||||
select ARCH_DAVINCI_DMx
|
||||
|
||||
comment "DaVinci Board Type"
|
||||
|
||||
config MACH_DA8XX_DT
|
||||
@@ -61,117 +46,6 @@ config MACH_DA8XX_DT
|
||||
Say y here to include support for TI DaVinci DA850 based using
|
||||
Flattened Device Tree. More information at Documentation/devicetree
|
||||
|
||||
config MACH_DAVINCI_DM355_EVM
|
||||
bool "TI DM355 EVM"
|
||||
default ARCH_DAVINCI_DM355
|
||||
depends on ARCH_DAVINCI_DM355
|
||||
help
|
||||
Configure this option to specify the whether the board used
|
||||
for development is a DM355 EVM
|
||||
|
||||
config MACH_DM355_LEOPARD
|
||||
bool "DM355 Leopard board"
|
||||
depends on ARCH_DAVINCI_DM355
|
||||
help
|
||||
Configure this option to specify the whether the board used
|
||||
for development is a DM355 Leopard board.
|
||||
|
||||
config MACH_DAVINCI_DM365_EVM
|
||||
bool "TI DM365 EVM"
|
||||
default ARCH_DAVINCI_DM365
|
||||
depends on ARCH_DAVINCI_DM365
|
||||
help
|
||||
Configure this option to specify whether the board used
|
||||
for development is a DM365 EVM
|
||||
|
||||
config MACH_DAVINCI_DA830_EVM
|
||||
bool "TI DA830/OMAP-L137/AM17x Reference Platform"
|
||||
default ARCH_DAVINCI_DA830
|
||||
depends on ATAGS && UNUSED_BOARD_FILES
|
||||
depends on ARCH_DAVINCI_DA830
|
||||
select GPIO_PCF857X if I2C
|
||||
help
|
||||
Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module.
|
||||
|
||||
choice
|
||||
prompt "Select DA830/OMAP-L137/AM17x UI board peripheral"
|
||||
depends on MACH_DAVINCI_DA830_EVM
|
||||
help
|
||||
The presence of UI card on the DA830/OMAP-L137/AM17x EVM is
|
||||
detected automatically based on successful probe of the I2C
|
||||
based GPIO expander on that board. This option selected in this
|
||||
menu has an effect only in case of a successful UI card detection.
|
||||
|
||||
config DA830_UI_LCD
|
||||
bool "LCD"
|
||||
help
|
||||
Say Y here to use the LCD as a framebuffer or simple character
|
||||
display.
|
||||
|
||||
config DA830_UI_NAND
|
||||
bool "NAND flash"
|
||||
help
|
||||
Say Y here to use the NAND flash. Do not forget to setup
|
||||
the switch correctly.
|
||||
endchoice
|
||||
|
||||
config MACH_DAVINCI_DA850_EVM
|
||||
bool "TI DA850/OMAP-L138/AM18x Reference Platform"
|
||||
depends on ATAGS && UNUSED_BOARD_FILES
|
||||
default ARCH_DAVINCI_DA850
|
||||
depends on ARCH_DAVINCI_DA850
|
||||
help
|
||||
Say Y here to select the TI DA850/OMAP-L138/AM18x Evaluation Module.
|
||||
|
||||
choice
|
||||
prompt "Select peripherals connected to expander on UI board"
|
||||
depends on MACH_DAVINCI_DA850_EVM
|
||||
help
|
||||
The presence of User Interface (UI) card on the DA850/OMAP-L138/AM18x
|
||||
EVM is detected automatically based on successful probe of the I2C
|
||||
based GPIO expander on that card. This option selected in this
|
||||
menu has an effect only in case of a successful UI card detection.
|
||||
|
||||
config DA850_UI_NONE
|
||||
bool "No peripheral is enabled"
|
||||
help
|
||||
Say Y if you do not want to enable any of the peripherals connected
|
||||
to TCA6416 expander on DA850/OMAP-L138/AM18x EVM UI card
|
||||
|
||||
config DA850_UI_RMII
|
||||
bool "RMII Ethernet PHY"
|
||||
help
|
||||
Say Y if you want to use the RMII PHY on the DA850/OMAP-L138/AM18x
|
||||
EVM. This PHY is found on the UI daughter card that is supplied with
|
||||
the EVM.
|
||||
NOTE: Please take care while choosing this option, MII PHY will
|
||||
not be functional if RMII mode is selected.
|
||||
|
||||
config DA850_UI_SD_VIDEO_PORT
|
||||
bool "Video Port Interface"
|
||||
help
|
||||
Say Y if you want to use Video Port Interface (VPIF) on the
|
||||
DA850/OMAP-L138 EVM. The Video decoders/encoders are found on the
|
||||
UI daughter card that is supplied with the EVM.
|
||||
|
||||
endchoice
|
||||
|
||||
config MACH_MITYOMAPL138
|
||||
bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
|
||||
depends on ARCH_DAVINCI_DA850
|
||||
depends on ATAGS && UNUSED_BOARD_FILES
|
||||
help
|
||||
Say Y here to select the Critical Link MityDSP-L138/MityARM-1808
|
||||
System on Module. Information on this SoM may be found at
|
||||
https://www.mitydsp.com
|
||||
|
||||
config MACH_OMAPL138_HAWKBOARD
|
||||
bool "TI AM1808 / OMAPL-138 Hawkboard platform"
|
||||
depends on ARCH_DAVINCI_DA850
|
||||
depends on ATAGS && UNUSED_BOARD_FILES
|
||||
help
|
||||
Say Y here to select the TI AM1808 / OMAPL-138 Hawkboard platform .
|
||||
|
||||
config DAVINCI_MUX
|
||||
bool "DAVINCI multiplexing support"
|
||||
depends on ARCH_DAVINCI
|
||||
|
||||
@@ -10,20 +10,11 @@ obj-y := serial.o usb.o common.o sram.o
|
||||
obj-$(CONFIG_DAVINCI_MUX) += mux.o
|
||||
|
||||
# Chip specific
|
||||
obj-$(CONFIG_ARCH_DAVINCI_DM355) += dm355.o devices.o
|
||||
obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o
|
||||
obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o usb-da8xx.o
|
||||
obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o usb-da8xx.o
|
||||
|
||||
# Board specific
|
||||
obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o pdata-quirks.o
|
||||
obj-$(CONFIG_MACH_DAVINCI_DM355_EVM) += board-dm355-evm.o
|
||||
obj-$(CONFIG_MACH_DM355_LEOPARD) += board-dm355-leopard.o
|
||||
obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o
|
||||
obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o
|
||||
obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o
|
||||
obj-$(CONFIG_MACH_MITYOMAPL138) += board-mityomapl138.o
|
||||
obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD) += board-omapl138-hawk.o
|
||||
|
||||
# Power Management
|
||||
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,444 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* TI DaVinci EVM board support
|
||||
*
|
||||
* Author: Kevin Hilman, Deep Root Systems, LLC
|
||||
*
|
||||
* 2007 (c) MontaVista Software, Inc.
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/rawnand.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio/machine.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/dm9000.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include <media/i2c/tvp514x.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/eeprom.h>
|
||||
#include <linux/platform_data/gpio-davinci.h>
|
||||
#include <linux/platform_data/i2c-davinci.h>
|
||||
#include <linux/platform_data/mtd-davinci.h>
|
||||
#include <linux/platform_data/mmc-davinci.h>
|
||||
#include <linux/platform_data/usb-davinci.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
#include "serial.h"
|
||||
#include "common.h"
|
||||
#include "davinci.h"
|
||||
|
||||
/* NOTE: this is geared for the standard config, with a socketed
|
||||
* 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
|
||||
* swap chips, maybe with a different block size, partitioning may
|
||||
* need to be changed.
|
||||
*/
|
||||
#define NAND_BLOCK_SIZE SZ_128K
|
||||
|
||||
static struct mtd_partition davinci_nand_partitions[] = {
|
||||
{
|
||||
/* UBL (a few copies) plus U-Boot */
|
||||
.name = "bootloader",
|
||||
.offset = 0,
|
||||
.size = 15 * NAND_BLOCK_SIZE,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
}, {
|
||||
/* U-Boot environment */
|
||||
.name = "params",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 1 * NAND_BLOCK_SIZE,
|
||||
.mask_flags = 0,
|
||||
}, {
|
||||
.name = "kernel",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_4M,
|
||||
.mask_flags = 0,
|
||||
}, {
|
||||
.name = "filesystem1",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_512M,
|
||||
.mask_flags = 0,
|
||||
}, {
|
||||
.name = "filesystem2",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
.mask_flags = 0,
|
||||
}
|
||||
/* two blocks with bad block table (and mirror) at the end */
|
||||
};
|
||||
|
||||
static struct davinci_nand_pdata davinci_nand_data = {
|
||||
.core_chipsel = 0,
|
||||
.mask_chipsel = BIT(14),
|
||||
.parts = davinci_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(davinci_nand_partitions),
|
||||
.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
.ecc_bits = 4,
|
||||
};
|
||||
|
||||
static struct resource davinci_nand_resources[] = {
|
||||
{
|
||||
.start = DM355_ASYNC_EMIF_DATA_CE0_BASE,
|
||||
.end = DM355_ASYNC_EMIF_DATA_CE0_BASE + SZ_32M - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = DM355_ASYNC_EMIF_CONTROL_BASE,
|
||||
.end = DM355_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device davinci_nand_device = {
|
||||
.name = "davinci_nand",
|
||||
.id = 0,
|
||||
|
||||
.num_resources = ARRAY_SIZE(davinci_nand_resources),
|
||||
.resource = davinci_nand_resources,
|
||||
|
||||
.dev = {
|
||||
.platform_data = &davinci_nand_data,
|
||||
},
|
||||
};
|
||||
|
||||
#define DM355_I2C_SDA_PIN GPIO_TO_PIN(0, 15)
|
||||
#define DM355_I2C_SCL_PIN GPIO_TO_PIN(0, 14)
|
||||
|
||||
static struct gpiod_lookup_table i2c_recovery_gpiod_table = {
|
||||
.dev_id = "i2c_davinci.1",
|
||||
.table = {
|
||||
GPIO_LOOKUP("davinci_gpio", DM355_I2C_SDA_PIN, "sda",
|
||||
GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
|
||||
GPIO_LOOKUP("davinci_gpio", DM355_I2C_SCL_PIN, "scl",
|
||||
GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
|
||||
{ }
|
||||
},
|
||||
};
|
||||
|
||||
static struct davinci_i2c_platform_data i2c_pdata = {
|
||||
.bus_freq = 400 /* kHz */,
|
||||
.bus_delay = 0 /* usec */,
|
||||
.gpio_recovery = true,
|
||||
};
|
||||
|
||||
static int dm355evm_mmc_gpios = -EINVAL;
|
||||
|
||||
static void dm355evm_mmcsd_gpios(unsigned gpio)
|
||||
{
|
||||
gpio_request(gpio + 0, "mmc0_ro");
|
||||
gpio_request(gpio + 1, "mmc0_cd");
|
||||
gpio_request(gpio + 2, "mmc1_ro");
|
||||
gpio_request(gpio + 3, "mmc1_cd");
|
||||
|
||||
/* we "know" these are input-only so we don't
|
||||
* need to call gpio_direction_input()
|
||||
*/
|
||||
|
||||
dm355evm_mmc_gpios = gpio;
|
||||
}
|
||||
|
||||
static struct i2c_board_info dm355evm_i2c_info[] = {
|
||||
{ I2C_BOARD_INFO("dm355evm_msp", 0x25),
|
||||
.platform_data = dm355evm_mmcsd_gpios,
|
||||
},
|
||||
/* { plus irq }, */
|
||||
{ I2C_BOARD_INFO("tlv320aic33", 0x1b), },
|
||||
};
|
||||
|
||||
static void __init evm_init_i2c(void)
|
||||
{
|
||||
gpiod_add_lookup_table(&i2c_recovery_gpiod_table);
|
||||
davinci_init_i2c(&i2c_pdata);
|
||||
|
||||
gpio_request(5, "dm355evm_msp");
|
||||
gpio_direction_input(5);
|
||||
dm355evm_i2c_info[0].irq = gpio_to_irq(5);
|
||||
|
||||
i2c_register_board_info(1, dm355evm_i2c_info,
|
||||
ARRAY_SIZE(dm355evm_i2c_info));
|
||||
}
|
||||
|
||||
static struct resource dm355evm_dm9000_rsrc[] = {
|
||||
{
|
||||
/* addr */
|
||||
.start = 0x04014000,
|
||||
.end = 0x04014001,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
/* data */
|
||||
.start = 0x04014002,
|
||||
.end = 0x04014003,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.flags = IORESOURCE_IRQ
|
||||
| IORESOURCE_IRQ_HIGHEDGE /* rising (active high) */,
|
||||
},
|
||||
};
|
||||
|
||||
static struct dm9000_plat_data dm335evm_dm9000_platdata;
|
||||
|
||||
static struct platform_device dm355evm_dm9000 = {
|
||||
.name = "dm9000",
|
||||
.id = -1,
|
||||
.resource = dm355evm_dm9000_rsrc,
|
||||
.num_resources = ARRAY_SIZE(dm355evm_dm9000_rsrc),
|
||||
.dev = {
|
||||
.platform_data = &dm335evm_dm9000_platdata,
|
||||
},
|
||||
};
|
||||
|
||||
static struct tvp514x_platform_data tvp5146_pdata = {
|
||||
.clk_polarity = 0,
|
||||
.hs_polarity = 1,
|
||||
.vs_polarity = 1
|
||||
};
|
||||
|
||||
#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
|
||||
/* Inputs available at the TVP5146 */
|
||||
static struct v4l2_input tvp5146_inputs[] = {
|
||||
{
|
||||
.index = 0,
|
||||
.name = "Composite",
|
||||
.type = V4L2_INPUT_TYPE_CAMERA,
|
||||
.std = TVP514X_STD_ALL,
|
||||
},
|
||||
{
|
||||
.index = 1,
|
||||
.name = "S-Video",
|
||||
.type = V4L2_INPUT_TYPE_CAMERA,
|
||||
.std = TVP514X_STD_ALL,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* this is the route info for connecting each input to decoder
|
||||
* ouput that goes to vpfe. There is a one to one correspondence
|
||||
* with tvp5146_inputs
|
||||
*/
|
||||
static struct vpfe_route tvp5146_routes[] = {
|
||||
{
|
||||
.input = INPUT_CVBS_VI2B,
|
||||
.output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
|
||||
},
|
||||
{
|
||||
.input = INPUT_SVIDEO_VI2C_VI1C,
|
||||
.output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
|
||||
},
|
||||
};
|
||||
|
||||
static struct vpfe_subdev_info vpfe_sub_devs[] = {
|
||||
{
|
||||
.name = "tvp5146",
|
||||
.grp_id = 0,
|
||||
.num_inputs = ARRAY_SIZE(tvp5146_inputs),
|
||||
.inputs = tvp5146_inputs,
|
||||
.routes = tvp5146_routes,
|
||||
.can_route = 1,
|
||||
.ccdc_if_params = {
|
||||
.if_type = VPFE_BT656,
|
||||
.hdpol = VPFE_PINPOL_POSITIVE,
|
||||
.vdpol = VPFE_PINPOL_POSITIVE,
|
||||
},
|
||||
.board_info = {
|
||||
I2C_BOARD_INFO("tvp5146", 0x5d),
|
||||
.platform_data = &tvp5146_pdata,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
static struct vpfe_config vpfe_cfg = {
|
||||
.num_subdevs = ARRAY_SIZE(vpfe_sub_devs),
|
||||
.i2c_adapter_id = 1,
|
||||
.sub_devs = vpfe_sub_devs,
|
||||
.card_name = "DM355 EVM",
|
||||
.ccdc = "DM355 CCDC",
|
||||
};
|
||||
|
||||
/* venc standards timings */
|
||||
static struct vpbe_enc_mode_info dm355evm_enc_preset_timing[] = {
|
||||
{
|
||||
.name = "ntsc",
|
||||
.timings_type = VPBE_ENC_STD,
|
||||
.std_id = V4L2_STD_NTSC,
|
||||
.interlaced = 1,
|
||||
.xres = 720,
|
||||
.yres = 480,
|
||||
.aspect = {11, 10},
|
||||
.fps = {30000, 1001},
|
||||
.left_margin = 0x79,
|
||||
.upper_margin = 0x10,
|
||||
},
|
||||
{
|
||||
.name = "pal",
|
||||
.timings_type = VPBE_ENC_STD,
|
||||
.std_id = V4L2_STD_PAL,
|
||||
.interlaced = 1,
|
||||
.xres = 720,
|
||||
.yres = 576,
|
||||
.aspect = {54, 59},
|
||||
.fps = {25, 1},
|
||||
.left_margin = 0x7E,
|
||||
.upper_margin = 0x16
|
||||
},
|
||||
};
|
||||
|
||||
#define VENC_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
|
||||
|
||||
/*
|
||||
* The outputs available from VPBE + ecnoders. Keep the
|
||||
* the order same as that of encoders. First those from venc followed by that
|
||||
* from encoders. Index in the output refers to index on a particular encoder.
|
||||
* Driver uses this index to pass it to encoder when it supports more than
|
||||
* one output. Application uses index of the array to set an output.
|
||||
*/
|
||||
static struct vpbe_output dm355evm_vpbe_outputs[] = {
|
||||
{
|
||||
.output = {
|
||||
.index = 0,
|
||||
.name = "Composite",
|
||||
.type = V4L2_OUTPUT_TYPE_ANALOG,
|
||||
.std = VENC_STD_ALL,
|
||||
.capabilities = V4L2_OUT_CAP_STD,
|
||||
},
|
||||
.subdev_name = DM355_VPBE_VENC_SUBDEV_NAME,
|
||||
.default_mode = "ntsc",
|
||||
.num_modes = ARRAY_SIZE(dm355evm_enc_preset_timing),
|
||||
.modes = dm355evm_enc_preset_timing,
|
||||
.if_params = MEDIA_BUS_FMT_FIXED,
|
||||
},
|
||||
};
|
||||
|
||||
static struct vpbe_config dm355evm_display_cfg = {
|
||||
.module_name = "dm355-vpbe-display",
|
||||
.i2c_adapter_id = 1,
|
||||
.osd = {
|
||||
.module_name = DM355_VPBE_OSD_SUBDEV_NAME,
|
||||
},
|
||||
.venc = {
|
||||
.module_name = DM355_VPBE_VENC_SUBDEV_NAME,
|
||||
},
|
||||
.num_outputs = ARRAY_SIZE(dm355evm_vpbe_outputs),
|
||||
.outputs = dm355evm_vpbe_outputs,
|
||||
};
|
||||
|
||||
static struct platform_device *davinci_evm_devices[] __initdata = {
|
||||
&dm355evm_dm9000,
|
||||
&davinci_nand_device,
|
||||
};
|
||||
|
||||
static void __init dm355_evm_map_io(void)
|
||||
{
|
||||
dm355_init();
|
||||
}
|
||||
|
||||
static int dm355evm_mmc_get_cd(int module)
|
||||
{
|
||||
if (!gpio_is_valid(dm355evm_mmc_gpios))
|
||||
return -ENXIO;
|
||||
/* low == card present */
|
||||
return !gpio_get_value_cansleep(dm355evm_mmc_gpios + 2 * module + 1);
|
||||
}
|
||||
|
||||
static int dm355evm_mmc_get_ro(int module)
|
||||
{
|
||||
if (!gpio_is_valid(dm355evm_mmc_gpios))
|
||||
return -ENXIO;
|
||||
/* high == card's write protect switch active */
|
||||
return gpio_get_value_cansleep(dm355evm_mmc_gpios + 2 * module + 0);
|
||||
}
|
||||
|
||||
static struct davinci_mmc_config dm355evm_mmc_config = {
|
||||
.get_cd = dm355evm_mmc_get_cd,
|
||||
.get_ro = dm355evm_mmc_get_ro,
|
||||
.wires = 4,
|
||||
.max_freq = 50000000,
|
||||
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
|
||||
};
|
||||
|
||||
/* Don't connect anything to J10 unless you're only using USB host
|
||||
* mode *and* have to do so with some kind of gender-bender. If
|
||||
* you have proper Mini-B or Mini-A cables (or Mini-A adapters)
|
||||
* the ID pin won't need any help.
|
||||
*/
|
||||
#define USB_ID_VALUE 1 /* ID pulled low */
|
||||
|
||||
static struct spi_eeprom at25640a = {
|
||||
.byte_len = SZ_64K / 8,
|
||||
.name = "at25640a",
|
||||
.page_size = 32,
|
||||
.flags = EE_ADDR2,
|
||||
};
|
||||
|
||||
static const struct spi_board_info dm355_evm_spi_info[] __initconst = {
|
||||
{
|
||||
.modalias = "at25",
|
||||
.platform_data = &at25640a,
|
||||
.max_speed_hz = 10 * 1000 * 1000, /* at 3v3 */
|
||||
.bus_num = 0,
|
||||
.chip_select = 0,
|
||||
.mode = SPI_MODE_0,
|
||||
},
|
||||
};
|
||||
|
||||
static __init void dm355_evm_init(void)
|
||||
{
|
||||
struct clk *aemif;
|
||||
int ret;
|
||||
|
||||
dm355_register_clocks();
|
||||
|
||||
ret = dm355_gpio_register();
|
||||
if (ret)
|
||||
pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
|
||||
|
||||
gpio_request(1, "dm9000");
|
||||
gpio_direction_input(1);
|
||||
dm355evm_dm9000_rsrc[2].start = gpio_to_irq(1);
|
||||
|
||||
aemif = clk_get(&dm355evm_dm9000.dev, "aemif");
|
||||
if (!WARN(IS_ERR(aemif), "unable to get AEMIF clock\n"))
|
||||
clk_prepare_enable(aemif);
|
||||
|
||||
platform_add_devices(davinci_evm_devices,
|
||||
ARRAY_SIZE(davinci_evm_devices));
|
||||
evm_init_i2c();
|
||||
davinci_serial_init(dm355_serial_device);
|
||||
|
||||
/* NOTE: NAND flash timings set by the UBL are slower than
|
||||
* needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204
|
||||
* but could be 0x0400008c for about 25% faster page reads.
|
||||
*/
|
||||
|
||||
gpio_request(2, "usb_id_toggle");
|
||||
gpio_direction_output(2, USB_ID_VALUE);
|
||||
/* irlml6401 switches over 1A in under 8 msec */
|
||||
davinci_setup_usb(1000, 8);
|
||||
|
||||
davinci_setup_mmc(0, &dm355evm_mmc_config);
|
||||
davinci_setup_mmc(1, &dm355evm_mmc_config);
|
||||
|
||||
dm355_init_video(&vpfe_cfg, &dm355evm_display_cfg);
|
||||
|
||||
dm355_init_spi0(BIT(0), dm355_evm_spi_info,
|
||||
ARRAY_SIZE(dm355_evm_spi_info));
|
||||
|
||||
/* DM335 EVM uses ASP1; line-out is a stereo mini-jack */
|
||||
dm355_init_asp1(ASP1_TX_EVT_EN | ASP1_RX_EVT_EN);
|
||||
}
|
||||
|
||||
MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
|
||||
.atag_offset = 0x100,
|
||||
.map_io = dm355_evm_map_io,
|
||||
.init_irq = dm355_init_irq,
|
||||
.init_time = dm355_init_time,
|
||||
.init_machine = dm355_evm_init,
|
||||
.init_late = davinci_init_late,
|
||||
.dma_zone_size = SZ_128M,
|
||||
MACHINE_END
|
||||
@@ -1,278 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* DM355 leopard board support
|
||||
*
|
||||
* Based on board-dm355-evm.c
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/rawnand.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/eeprom.h>
|
||||
#include <linux/platform_data/i2c-davinci.h>
|
||||
#include <linux/platform_data/mmc-davinci.h>
|
||||
#include <linux/platform_data/mtd-davinci.h>
|
||||
#include <linux/platform_data/usb-davinci.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "serial.h"
|
||||
#include "davinci.h"
|
||||
|
||||
/* NOTE: this is geared for the standard config, with a socketed
|
||||
* 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
|
||||
* swap chips, maybe with a different block size, partitioning may
|
||||
* need to be changed.
|
||||
*/
|
||||
#define NAND_BLOCK_SIZE SZ_128K
|
||||
|
||||
static struct mtd_partition davinci_nand_partitions[] = {
|
||||
{
|
||||
/* UBL (a few copies) plus U-Boot */
|
||||
.name = "bootloader",
|
||||
.offset = 0,
|
||||
.size = 15 * NAND_BLOCK_SIZE,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
}, {
|
||||
/* U-Boot environment */
|
||||
.name = "params",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 1 * NAND_BLOCK_SIZE,
|
||||
.mask_flags = 0,
|
||||
}, {
|
||||
.name = "kernel",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_4M,
|
||||
.mask_flags = 0,
|
||||
}, {
|
||||
.name = "filesystem1",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_512M,
|
||||
.mask_flags = 0,
|
||||
}, {
|
||||
.name = "filesystem2",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
.mask_flags = 0,
|
||||
}
|
||||
/* two blocks with bad block table (and mirror) at the end */
|
||||
};
|
||||
|
||||
static struct davinci_nand_pdata davinci_nand_data = {
|
||||
.core_chipsel = 0,
|
||||
.mask_chipsel = BIT(14),
|
||||
.parts = davinci_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(davinci_nand_partitions),
|
||||
.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST,
|
||||
.ecc_placement = NAND_ECC_PLACEMENT_INTERLEAVED,
|
||||
.ecc_bits = 4,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
};
|
||||
|
||||
static struct resource davinci_nand_resources[] = {
|
||||
{
|
||||
.start = DM355_ASYNC_EMIF_DATA_CE0_BASE,
|
||||
.end = DM355_ASYNC_EMIF_DATA_CE0_BASE + SZ_32M - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = DM355_ASYNC_EMIF_CONTROL_BASE,
|
||||
.end = DM355_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device davinci_nand_device = {
|
||||
.name = "davinci_nand",
|
||||
.id = 0,
|
||||
|
||||
.num_resources = ARRAY_SIZE(davinci_nand_resources),
|
||||
.resource = davinci_nand_resources,
|
||||
|
||||
.dev = {
|
||||
.platform_data = &davinci_nand_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct davinci_i2c_platform_data i2c_pdata = {
|
||||
.bus_freq = 400 /* kHz */,
|
||||
.bus_delay = 0 /* usec */,
|
||||
};
|
||||
|
||||
static int leopard_mmc_gpio = -EINVAL;
|
||||
|
||||
static void dm355leopard_mmcsd_gpios(unsigned gpio)
|
||||
{
|
||||
gpio_request(gpio + 0, "mmc0_ro");
|
||||
gpio_request(gpio + 1, "mmc0_cd");
|
||||
gpio_request(gpio + 2, "mmc1_ro");
|
||||
gpio_request(gpio + 3, "mmc1_cd");
|
||||
|
||||
/* we "know" these are input-only so we don't
|
||||
* need to call gpio_direction_input()
|
||||
*/
|
||||
|
||||
leopard_mmc_gpio = gpio;
|
||||
}
|
||||
|
||||
static struct i2c_board_info dm355leopard_i2c_info[] = {
|
||||
{ I2C_BOARD_INFO("dm355leopard_msp", 0x25),
|
||||
.platform_data = dm355leopard_mmcsd_gpios,
|
||||
/* plus irq */ },
|
||||
/* { I2C_BOARD_INFO("tlv320aic3x", 0x1b), }, */
|
||||
/* { I2C_BOARD_INFO("tvp5146", 0x5d), }, */
|
||||
};
|
||||
|
||||
static void __init leopard_init_i2c(void)
|
||||
{
|
||||
davinci_init_i2c(&i2c_pdata);
|
||||
|
||||
gpio_request(5, "dm355leopard_msp");
|
||||
gpio_direction_input(5);
|
||||
dm355leopard_i2c_info[0].irq = gpio_to_irq(5);
|
||||
|
||||
i2c_register_board_info(1, dm355leopard_i2c_info,
|
||||
ARRAY_SIZE(dm355leopard_i2c_info));
|
||||
}
|
||||
|
||||
static struct resource dm355leopard_dm9000_rsrc[] = {
|
||||
{
|
||||
/* addr */
|
||||
.start = 0x04000000,
|
||||
.end = 0x04000001,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
/* data */
|
||||
.start = 0x04000016,
|
||||
.end = 0x04000017,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.flags = IORESOURCE_IRQ
|
||||
| IORESOURCE_IRQ_HIGHEDGE /* rising (active high) */,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device dm355leopard_dm9000 = {
|
||||
.name = "dm9000",
|
||||
.id = -1,
|
||||
.resource = dm355leopard_dm9000_rsrc,
|
||||
.num_resources = ARRAY_SIZE(dm355leopard_dm9000_rsrc),
|
||||
};
|
||||
|
||||
static struct platform_device *davinci_leopard_devices[] __initdata = {
|
||||
&dm355leopard_dm9000,
|
||||
&davinci_nand_device,
|
||||
};
|
||||
|
||||
static void __init dm355_leopard_map_io(void)
|
||||
{
|
||||
dm355_init();
|
||||
}
|
||||
|
||||
static int dm355leopard_mmc_get_cd(int module)
|
||||
{
|
||||
if (!gpio_is_valid(leopard_mmc_gpio))
|
||||
return -ENXIO;
|
||||
/* low == card present */
|
||||
return !gpio_get_value_cansleep(leopard_mmc_gpio + 2 * module + 1);
|
||||
}
|
||||
|
||||
static int dm355leopard_mmc_get_ro(int module)
|
||||
{
|
||||
if (!gpio_is_valid(leopard_mmc_gpio))
|
||||
return -ENXIO;
|
||||
/* high == card's write protect switch active */
|
||||
return gpio_get_value_cansleep(leopard_mmc_gpio + 2 * module + 0);
|
||||
}
|
||||
|
||||
static struct davinci_mmc_config dm355leopard_mmc_config = {
|
||||
.get_cd = dm355leopard_mmc_get_cd,
|
||||
.get_ro = dm355leopard_mmc_get_ro,
|
||||
.wires = 4,
|
||||
.max_freq = 50000000,
|
||||
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
|
||||
};
|
||||
|
||||
/* Don't connect anything to J10 unless you're only using USB host
|
||||
* mode *and* have to do so with some kind of gender-bender. If
|
||||
* you have proper Mini-B or Mini-A cables (or Mini-A adapters)
|
||||
* the ID pin won't need any help.
|
||||
*/
|
||||
#define USB_ID_VALUE 1 /* ID pulled low */
|
||||
|
||||
static struct spi_eeprom at25640a = {
|
||||
.byte_len = SZ_64K / 8,
|
||||
.name = "at25640a",
|
||||
.page_size = 32,
|
||||
.flags = EE_ADDR2,
|
||||
};
|
||||
|
||||
static const struct spi_board_info dm355_leopard_spi_info[] __initconst = {
|
||||
{
|
||||
.modalias = "at25",
|
||||
.platform_data = &at25640a,
|
||||
.max_speed_hz = 10 * 1000 * 1000, /* at 3v3 */
|
||||
.bus_num = 0,
|
||||
.chip_select = 0,
|
||||
.mode = SPI_MODE_0,
|
||||
},
|
||||
};
|
||||
|
||||
static __init void dm355_leopard_init(void)
|
||||
{
|
||||
struct clk *aemif;
|
||||
int ret;
|
||||
|
||||
dm355_register_clocks();
|
||||
|
||||
ret = dm355_gpio_register();
|
||||
if (ret)
|
||||
pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
|
||||
|
||||
gpio_request(9, "dm9000");
|
||||
gpio_direction_input(9);
|
||||
dm355leopard_dm9000_rsrc[2].start = gpio_to_irq(9);
|
||||
|
||||
aemif = clk_get(&dm355leopard_dm9000.dev, "aemif");
|
||||
if (!WARN(IS_ERR(aemif), "unable to get AEMIF clock\n"))
|
||||
clk_prepare_enable(aemif);
|
||||
|
||||
platform_add_devices(davinci_leopard_devices,
|
||||
ARRAY_SIZE(davinci_leopard_devices));
|
||||
leopard_init_i2c();
|
||||
davinci_serial_init(dm355_serial_device);
|
||||
|
||||
/* NOTE: NAND flash timings set by the UBL are slower than
|
||||
* needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204
|
||||
* but could be 0x0400008c for about 25% faster page reads.
|
||||
*/
|
||||
|
||||
gpio_request(2, "usb_id_toggle");
|
||||
gpio_direction_output(2, USB_ID_VALUE);
|
||||
/* irlml6401 switches over 1A in under 8 msec */
|
||||
davinci_setup_usb(1000, 8);
|
||||
|
||||
davinci_setup_mmc(0, &dm355leopard_mmc_config);
|
||||
davinci_setup_mmc(1, &dm355leopard_mmc_config);
|
||||
|
||||
dm355_init_spi0(BIT(0), dm355_leopard_spi_info,
|
||||
ARRAY_SIZE(dm355_leopard_spi_info));
|
||||
}
|
||||
|
||||
MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
|
||||
.atag_offset = 0x100,
|
||||
.map_io = dm355_leopard_map_io,
|
||||
.init_irq = dm355_init_irq,
|
||||
.init_time = dm355_init_time,
|
||||
.init_machine = dm355_leopard_init,
|
||||
.init_late = davinci_init_late,
|
||||
.dma_zone_size = SZ_128M,
|
||||
MACHINE_END
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,451 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Hawkboard.org based on TI's OMAP-L138 Platform
|
||||
*
|
||||
* Initial code: Syed Mohammed Khasim
|
||||
*
|
||||
* Copyright (C) 2009 Texas Instruments Incorporated - https://www.ti.com
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio/machine.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/rawnand.h>
|
||||
#include <linux/platform_data/gpio-davinci.h>
|
||||
#include <linux/platform_data/mtd-davinci.h>
|
||||
#include <linux/platform_data/mtd-davinci-aemif.h>
|
||||
#include <linux/platform_data/ti-aemif.h>
|
||||
#include <linux/regulator/fixed.h>
|
||||
#include <linux/regulator/machine.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "da8xx.h"
|
||||
#include "mux.h"
|
||||
|
||||
#define HAWKBOARD_PHY_ID "davinci_mdio-0:07"
|
||||
|
||||
#define DA850_USB1_VBUS_PIN GPIO_TO_PIN(2, 4)
|
||||
#define DA850_USB1_OC_PIN GPIO_TO_PIN(6, 13)
|
||||
|
||||
static short omapl138_hawk_mii_pins[] __initdata = {
|
||||
DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3,
|
||||
DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER,
|
||||
DA850_MII_CRS, DA850_MII_RXCLK, DA850_MII_RXDV, DA850_MII_RXD_3,
|
||||
DA850_MII_RXD_2, DA850_MII_RXD_1, DA850_MII_RXD_0, DA850_MDIO_CLK,
|
||||
DA850_MDIO_D,
|
||||
-1
|
||||
};
|
||||
|
||||
static __init void omapl138_hawk_config_emac(void)
|
||||
{
|
||||
void __iomem *cfgchip3 = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG);
|
||||
int ret;
|
||||
u32 val;
|
||||
struct davinci_soc_info *soc_info = &davinci_soc_info;
|
||||
|
||||
val = __raw_readl(cfgchip3);
|
||||
val &= ~BIT(8);
|
||||
ret = davinci_cfg_reg_list(omapl138_hawk_mii_pins);
|
||||
if (ret) {
|
||||
pr_warn("%s: CPGMAC/MII mux setup failed: %d\n", __func__, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
/* configure the CFGCHIP3 register for MII */
|
||||
__raw_writel(val, cfgchip3);
|
||||
pr_info("EMAC: MII PHY configured\n");
|
||||
|
||||
soc_info->emac_pdata->phy_id = HAWKBOARD_PHY_ID;
|
||||
|
||||
ret = da8xx_register_emac();
|
||||
if (ret)
|
||||
pr_warn("%s: EMAC registration failed: %d\n", __func__, ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* The following EDMA channels/slots are not being used by drivers (for
|
||||
* example: Timer, GPIO, UART events etc) on da850/omap-l138 EVM/Hawkboard,
|
||||
* hence they are being reserved for codecs on the DSP side.
|
||||
*/
|
||||
static const s16 da850_dma0_rsv_chans[][2] = {
|
||||
/* (offset, number) */
|
||||
{ 8, 6},
|
||||
{24, 4},
|
||||
{30, 2},
|
||||
{-1, -1}
|
||||
};
|
||||
|
||||
static const s16 da850_dma0_rsv_slots[][2] = {
|
||||
/* (offset, number) */
|
||||
{ 8, 6},
|
||||
{24, 4},
|
||||
{30, 50},
|
||||
{-1, -1}
|
||||
};
|
||||
|
||||
static const s16 da850_dma1_rsv_chans[][2] = {
|
||||
/* (offset, number) */
|
||||
{ 0, 28},
|
||||
{30, 2},
|
||||
{-1, -1}
|
||||
};
|
||||
|
||||
static const s16 da850_dma1_rsv_slots[][2] = {
|
||||
/* (offset, number) */
|
||||
{ 0, 28},
|
||||
{30, 90},
|
||||
{-1, -1}
|
||||
};
|
||||
|
||||
static struct edma_rsv_info da850_edma_cc0_rsv = {
|
||||
.rsv_chans = da850_dma0_rsv_chans,
|
||||
.rsv_slots = da850_dma0_rsv_slots,
|
||||
};
|
||||
|
||||
static struct edma_rsv_info da850_edma_cc1_rsv = {
|
||||
.rsv_chans = da850_dma1_rsv_chans,
|
||||
.rsv_slots = da850_dma1_rsv_slots,
|
||||
};
|
||||
|
||||
static struct edma_rsv_info *da850_edma_rsv[2] = {
|
||||
&da850_edma_cc0_rsv,
|
||||
&da850_edma_cc1_rsv,
|
||||
};
|
||||
|
||||
static const short hawk_mmcsd0_pins[] = {
|
||||
DA850_MMCSD0_DAT_0, DA850_MMCSD0_DAT_1, DA850_MMCSD0_DAT_2,
|
||||
DA850_MMCSD0_DAT_3, DA850_MMCSD0_CLK, DA850_MMCSD0_CMD,
|
||||
DA850_GPIO3_12, DA850_GPIO3_13,
|
||||
-1
|
||||
};
|
||||
|
||||
#define DA850_HAWK_MMCSD_CD_PIN GPIO_TO_PIN(3, 12)
|
||||
#define DA850_HAWK_MMCSD_WP_PIN GPIO_TO_PIN(3, 13)
|
||||
|
||||
static struct gpiod_lookup_table mmc_gpios_table = {
|
||||
.dev_id = "da830-mmc.0",
|
||||
.table = {
|
||||
GPIO_LOOKUP("davinci_gpio", DA850_HAWK_MMCSD_CD_PIN, "cd",
|
||||
GPIO_ACTIVE_LOW),
|
||||
GPIO_LOOKUP("davinci_gpio", DA850_HAWK_MMCSD_WP_PIN, "wp",
|
||||
GPIO_ACTIVE_LOW),
|
||||
},
|
||||
};
|
||||
|
||||
static struct davinci_mmc_config da850_mmc_config = {
|
||||
.wires = 4,
|
||||
.max_freq = 50000000,
|
||||
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
|
||||
};
|
||||
|
||||
static __init void omapl138_hawk_mmc_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = davinci_cfg_reg_list(hawk_mmcsd0_pins);
|
||||
if (ret) {
|
||||
pr_warn("%s: MMC/SD0 mux setup failed: %d\n", __func__, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
gpiod_add_lookup_table(&mmc_gpios_table);
|
||||
|
||||
ret = da8xx_register_mmcsd0(&da850_mmc_config);
|
||||
if (ret) {
|
||||
pr_warn("%s: MMC/SD0 registration failed: %d\n", __func__, ret);
|
||||
goto mmc_setup_mmcsd_fail;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
mmc_setup_mmcsd_fail:
|
||||
gpiod_remove_lookup_table(&mmc_gpios_table);
|
||||
}
|
||||
|
||||
static struct mtd_partition omapl138_hawk_nandflash_partition[] = {
|
||||
{
|
||||
.name = "u-boot env",
|
||||
.offset = 0,
|
||||
.size = SZ_128K,
|
||||
.mask_flags = MTD_WRITEABLE,
|
||||
},
|
||||
{
|
||||
.name = "u-boot",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_512K,
|
||||
.mask_flags = MTD_WRITEABLE,
|
||||
},
|
||||
{
|
||||
.name = "free space",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
.mask_flags = 0,
|
||||
},
|
||||
};
|
||||
|
||||
static struct davinci_aemif_timing omapl138_hawk_nandflash_timing = {
|
||||
.wsetup = 24,
|
||||
.wstrobe = 21,
|
||||
.whold = 14,
|
||||
.rsetup = 19,
|
||||
.rstrobe = 50,
|
||||
.rhold = 0,
|
||||
.ta = 20,
|
||||
};
|
||||
|
||||
static struct davinci_nand_pdata omapl138_hawk_nandflash_data = {
|
||||
.core_chipsel = 1,
|
||||
.parts = omapl138_hawk_nandflash_partition,
|
||||
.nr_parts = ARRAY_SIZE(omapl138_hawk_nandflash_partition),
|
||||
.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST,
|
||||
.ecc_bits = 4,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
.options = NAND_BUSWIDTH_16,
|
||||
.timing = &omapl138_hawk_nandflash_timing,
|
||||
.mask_chipsel = 0,
|
||||
.mask_ale = 0,
|
||||
.mask_cle = 0,
|
||||
};
|
||||
|
||||
static struct resource omapl138_hawk_nandflash_resource[] = {
|
||||
{
|
||||
.start = DA8XX_AEMIF_CS3_BASE,
|
||||
.end = DA8XX_AEMIF_CS3_BASE + SZ_32M,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = DA8XX_AEMIF_CTL_BASE,
|
||||
.end = DA8XX_AEMIF_CTL_BASE + SZ_32K,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource omapl138_hawk_aemif_resource[] = {
|
||||
{
|
||||
.start = DA8XX_AEMIF_CTL_BASE,
|
||||
.end = DA8XX_AEMIF_CTL_BASE + SZ_32K,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
static struct aemif_abus_data omapl138_hawk_aemif_abus_data[] = {
|
||||
{
|
||||
.cs = 3,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device omapl138_hawk_aemif_devices[] = {
|
||||
{
|
||||
.name = "davinci_nand",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &omapl138_hawk_nandflash_data,
|
||||
},
|
||||
.resource = omapl138_hawk_nandflash_resource,
|
||||
.num_resources = ARRAY_SIZE(omapl138_hawk_nandflash_resource),
|
||||
}
|
||||
};
|
||||
|
||||
static struct aemif_platform_data omapl138_hawk_aemif_pdata = {
|
||||
.cs_offset = 2,
|
||||
.abus_data = omapl138_hawk_aemif_abus_data,
|
||||
.num_abus_data = ARRAY_SIZE(omapl138_hawk_aemif_abus_data),
|
||||
.sub_devices = omapl138_hawk_aemif_devices,
|
||||
.num_sub_devices = ARRAY_SIZE(omapl138_hawk_aemif_devices),
|
||||
};
|
||||
|
||||
static struct platform_device omapl138_hawk_aemif_device = {
|
||||
.name = "ti-aemif",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &omapl138_hawk_aemif_pdata,
|
||||
},
|
||||
.resource = omapl138_hawk_aemif_resource,
|
||||
.num_resources = ARRAY_SIZE(omapl138_hawk_aemif_resource),
|
||||
};
|
||||
|
||||
static const short omapl138_hawk_nand_pins[] = {
|
||||
DA850_EMA_WAIT_1, DA850_NEMA_OE, DA850_NEMA_WE, DA850_NEMA_CS_3,
|
||||
DA850_EMA_D_0, DA850_EMA_D_1, DA850_EMA_D_2, DA850_EMA_D_3,
|
||||
DA850_EMA_D_4, DA850_EMA_D_5, DA850_EMA_D_6, DA850_EMA_D_7,
|
||||
DA850_EMA_D_8, DA850_EMA_D_9, DA850_EMA_D_10, DA850_EMA_D_11,
|
||||
DA850_EMA_D_12, DA850_EMA_D_13, DA850_EMA_D_14, DA850_EMA_D_15,
|
||||
DA850_EMA_A_1, DA850_EMA_A_2,
|
||||
-1
|
||||
};
|
||||
|
||||
static int omapl138_hawk_register_aemif(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = davinci_cfg_reg_list(omapl138_hawk_nand_pins);
|
||||
if (ret)
|
||||
pr_warn("%s: NAND mux setup failed: %d\n", __func__, ret);
|
||||
|
||||
return platform_device_register(&omapl138_hawk_aemif_device);
|
||||
}
|
||||
|
||||
static const short da850_hawk_usb11_pins[] = {
|
||||
DA850_GPIO2_4, DA850_GPIO6_13,
|
||||
-1
|
||||
};
|
||||
|
||||
static struct regulator_consumer_supply hawk_usb_supplies[] = {
|
||||
REGULATOR_SUPPLY("vbus", NULL),
|
||||
};
|
||||
|
||||
static struct regulator_init_data hawk_usb_vbus_data = {
|
||||
.consumer_supplies = hawk_usb_supplies,
|
||||
.num_consumer_supplies = ARRAY_SIZE(hawk_usb_supplies),
|
||||
.constraints = {
|
||||
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
|
||||
},
|
||||
};
|
||||
|
||||
static struct fixed_voltage_config hawk_usb_vbus = {
|
||||
.supply_name = "vbus",
|
||||
.microvolts = 3300000,
|
||||
.init_data = &hawk_usb_vbus_data,
|
||||
};
|
||||
|
||||
static struct platform_device hawk_usb_vbus_device = {
|
||||
.name = "reg-fixed-voltage",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &hawk_usb_vbus,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpiod_lookup_table hawk_usb_oc_gpio_lookup = {
|
||||
.dev_id = "ohci-da8xx",
|
||||
.table = {
|
||||
GPIO_LOOKUP("davinci_gpio", DA850_USB1_OC_PIN, "oc", 0),
|
||||
{ }
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpiod_lookup_table hawk_usb_vbus_gpio_lookup = {
|
||||
.dev_id = "reg-fixed-voltage.0",
|
||||
.table = {
|
||||
GPIO_LOOKUP("davinci_gpio", DA850_USB1_VBUS_PIN, NULL, 0),
|
||||
{ }
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpiod_lookup_table *hawk_usb_gpio_lookups[] = {
|
||||
&hawk_usb_oc_gpio_lookup,
|
||||
&hawk_usb_vbus_gpio_lookup,
|
||||
};
|
||||
|
||||
static struct da8xx_ohci_root_hub omapl138_hawk_usb11_pdata = {
|
||||
/* TPS2087 switch @ 5V */
|
||||
.potpgt = (3 + 1) / 2, /* 3 ms max */
|
||||
};
|
||||
|
||||
static __init void omapl138_hawk_usb_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = davinci_cfg_reg_list(da850_hawk_usb11_pins);
|
||||
if (ret) {
|
||||
pr_warn("%s: USB 1.1 PinMux setup failed: %d\n", __func__, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = da8xx_register_usb_phy_clocks();
|
||||
if (ret)
|
||||
pr_warn("%s: USB PHY CLK registration failed: %d\n",
|
||||
__func__, ret);
|
||||
|
||||
gpiod_add_lookup_tables(hawk_usb_gpio_lookups,
|
||||
ARRAY_SIZE(hawk_usb_gpio_lookups));
|
||||
|
||||
ret = da8xx_register_usb_phy();
|
||||
if (ret)
|
||||
pr_warn("%s: USB PHY registration failed: %d\n",
|
||||
__func__, ret);
|
||||
|
||||
ret = platform_device_register(&hawk_usb_vbus_device);
|
||||
if (ret) {
|
||||
pr_warn("%s: Unable to register the vbus supply\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata);
|
||||
if (ret)
|
||||
pr_warn("%s: USB 1.1 registration failed: %d\n", __func__, ret);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static __init void omapl138_hawk_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
da850_register_clocks();
|
||||
|
||||
ret = da850_register_gpio();
|
||||
if (ret)
|
||||
pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
|
||||
|
||||
davinci_serial_init(da8xx_serial_device);
|
||||
|
||||
omapl138_hawk_config_emac();
|
||||
|
||||
ret = da850_register_edma(da850_edma_rsv);
|
||||
if (ret)
|
||||
pr_warn("%s: EDMA registration failed: %d\n", __func__, ret);
|
||||
|
||||
omapl138_hawk_mmc_init();
|
||||
|
||||
omapl138_hawk_usb_init();
|
||||
|
||||
ret = omapl138_hawk_register_aemif();
|
||||
if (ret)
|
||||
pr_warn("%s: aemif registration failed: %d\n", __func__, ret);
|
||||
|
||||
ret = da8xx_register_watchdog();
|
||||
if (ret)
|
||||
pr_warn("%s: watchdog registration failed: %d\n",
|
||||
__func__, ret);
|
||||
|
||||
ret = da8xx_register_rproc();
|
||||
if (ret)
|
||||
pr_warn("%s: dsp/rproc registration failed: %d\n",
|
||||
__func__, ret);
|
||||
|
||||
regulator_has_full_constraints();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SERIAL_8250_CONSOLE
|
||||
static int __init omapl138_hawk_console_init(void)
|
||||
{
|
||||
if (!machine_is_omapl138_hawkboard())
|
||||
return 0;
|
||||
|
||||
return add_preferred_console("ttyS", 2, "115200");
|
||||
}
|
||||
console_initcall(omapl138_hawk_console_init);
|
||||
#endif
|
||||
|
||||
static void __init omapl138_hawk_map_io(void)
|
||||
{
|
||||
da850_init();
|
||||
}
|
||||
|
||||
MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
|
||||
.atag_offset = 0x100,
|
||||
.map_io = omapl138_hawk_map_io,
|
||||
.init_irq = da850_init_irq,
|
||||
.init_time = da850_init_time,
|
||||
.init_machine = omapl138_hawk_init,
|
||||
.init_late = davinci_init_late,
|
||||
.dma_zone_size = SZ_128M,
|
||||
.reserve = da8xx_rproc_reserve_cma,
|
||||
MACHINE_END
|
||||
@@ -1,303 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* mach-davinci/devices.c
|
||||
*
|
||||
* DaVinci platform device setup/initialization
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/platform_data/i2c-davinci.h>
|
||||
#include <linux/platform_data/mmc-davinci.h>
|
||||
#include <linux/platform_data/edma.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/reboot.h>
|
||||
|
||||
#include "hardware.h"
|
||||
#include "cputype.h"
|
||||
#include "mux.h"
|
||||
#include "davinci.h"
|
||||
#include "irqs.h"
|
||||
|
||||
#define DAVINCI_I2C_BASE 0x01C21000
|
||||
#define DAVINCI_ATA_BASE 0x01C66000
|
||||
#define DAVINCI_MMCSD0_BASE 0x01E10000
|
||||
#define DM355_MMCSD0_BASE 0x01E11000
|
||||
#define DM355_MMCSD1_BASE 0x01E00000
|
||||
#define DM365_MMCSD0_BASE 0x01D11000
|
||||
#define DM365_MMCSD1_BASE 0x01D00000
|
||||
|
||||
void __iomem *davinci_sysmod_base;
|
||||
|
||||
void davinci_map_sysmod(void)
|
||||
{
|
||||
davinci_sysmod_base = ioremap(DAVINCI_SYSTEM_MODULE_BASE,
|
||||
0x800);
|
||||
/*
|
||||
* Throw a bug since a lot of board initialization code depends
|
||||
* on system module availability. ioremap() failing this early
|
||||
* need careful looking into anyway.
|
||||
*/
|
||||
BUG_ON(!davinci_sysmod_base);
|
||||
}
|
||||
|
||||
static struct resource i2c_resources[] = {
|
||||
{
|
||||
.start = DAVINCI_I2C_BASE,
|
||||
.end = DAVINCI_I2C_BASE + 0x40,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = DAVINCI_INTC_IRQ(IRQ_I2C),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device davinci_i2c_device = {
|
||||
.name = "i2c_davinci",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(i2c_resources),
|
||||
.resource = i2c_resources,
|
||||
};
|
||||
|
||||
void __init davinci_init_i2c(struct davinci_i2c_platform_data *pdata)
|
||||
{
|
||||
if (cpu_is_davinci_dm644x())
|
||||
davinci_cfg_reg(DM644X_I2C);
|
||||
|
||||
davinci_i2c_device.dev.platform_data = pdata;
|
||||
(void) platform_device_register(&davinci_i2c_device);
|
||||
}
|
||||
|
||||
static struct resource ide_resources[] = {
|
||||
{
|
||||
.start = DAVINCI_ATA_BASE,
|
||||
.end = DAVINCI_ATA_BASE + 0x7ff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = DAVINCI_INTC_IRQ(IRQ_IDE),
|
||||
.end = DAVINCI_INTC_IRQ(IRQ_IDE),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static u64 ide_dma_mask = DMA_BIT_MASK(32);
|
||||
|
||||
static struct platform_device ide_device = {
|
||||
.name = "palm_bk3710",
|
||||
.id = -1,
|
||||
.resource = ide_resources,
|
||||
.num_resources = ARRAY_SIZE(ide_resources),
|
||||
.dev = {
|
||||
.dma_mask = &ide_dma_mask,
|
||||
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||
},
|
||||
};
|
||||
|
||||
void __init davinci_init_ide(void)
|
||||
{
|
||||
if (cpu_is_davinci_dm644x()) {
|
||||
davinci_cfg_reg(DM644X_HPIEN_DISABLE);
|
||||
davinci_cfg_reg(DM644X_ATAEN);
|
||||
davinci_cfg_reg(DM644X_HDIREN);
|
||||
} else if (cpu_is_davinci_dm646x()) {
|
||||
/* IRQ_DM646X_IDE is the same as IRQ_IDE */
|
||||
davinci_cfg_reg(DM646X_ATAEN);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
return;
|
||||
}
|
||||
|
||||
platform_device_register(&ide_device);
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_MMC_DAVINCI)
|
||||
|
||||
static u64 mmcsd0_dma_mask = DMA_BIT_MASK(32);
|
||||
|
||||
static struct resource mmcsd0_resources[] = {
|
||||
{
|
||||
/* different on dm355 */
|
||||
.start = DAVINCI_MMCSD0_BASE,
|
||||
.end = DAVINCI_MMCSD0_BASE + SZ_4K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
/* IRQs: MMC/SD, then SDIO */
|
||||
{
|
||||
.start = DAVINCI_INTC_IRQ(IRQ_MMCINT),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}, {
|
||||
/* different on dm355 */
|
||||
.start = DAVINCI_INTC_IRQ(IRQ_SDIOINT),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device davinci_mmcsd0_device = {
|
||||
.name = "dm6441-mmc",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = &mmcsd0_dma_mask,
|
||||
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(mmcsd0_resources),
|
||||
.resource = mmcsd0_resources,
|
||||
};
|
||||
|
||||
static u64 mmcsd1_dma_mask = DMA_BIT_MASK(32);
|
||||
|
||||
static struct resource mmcsd1_resources[] = {
|
||||
{
|
||||
.start = DM355_MMCSD1_BASE,
|
||||
.end = DM355_MMCSD1_BASE + SZ_4K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
/* IRQs: MMC/SD, then SDIO */
|
||||
{
|
||||
.start = DAVINCI_INTC_IRQ(IRQ_DM355_MMCINT1),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}, {
|
||||
.start = DAVINCI_INTC_IRQ(IRQ_DM355_SDIOINT1),
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device davinci_mmcsd1_device = {
|
||||
.name = "dm6441-mmc",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.dma_mask = &mmcsd1_dma_mask,
|
||||
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(mmcsd1_resources),
|
||||
.resource = mmcsd1_resources,
|
||||
};
|
||||
|
||||
|
||||
void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
|
||||
{
|
||||
struct platform_device *pdev = NULL;
|
||||
|
||||
if (WARN_ON(cpu_is_davinci_dm646x()))
|
||||
return;
|
||||
|
||||
/* REVISIT: update PINMUX, ARM_IRQMUX, and EDMA_EVTMUX here too;
|
||||
* for example if MMCSD1 is used for SDIO, maybe DAT2 is unused.
|
||||
*
|
||||
* FIXME dm6441 (no MMC/SD), dm357 (one), and dm335 (two) are
|
||||
* not handled right here ...
|
||||
*/
|
||||
switch (module) {
|
||||
case 1:
|
||||
if (cpu_is_davinci_dm355()) {
|
||||
/* REVISIT we may not need all these pins if e.g. this
|
||||
* is a hard-wired SDIO device...
|
||||
*/
|
||||
davinci_cfg_reg(DM355_SD1_CMD);
|
||||
davinci_cfg_reg(DM355_SD1_CLK);
|
||||
davinci_cfg_reg(DM355_SD1_DATA0);
|
||||
davinci_cfg_reg(DM355_SD1_DATA1);
|
||||
davinci_cfg_reg(DM355_SD1_DATA2);
|
||||
davinci_cfg_reg(DM355_SD1_DATA3);
|
||||
} else if (cpu_is_davinci_dm365()) {
|
||||
/* Configure pull down control */
|
||||
unsigned v;
|
||||
|
||||
v = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_PUPDCTL1));
|
||||
__raw_writel(v & ~0xfc0,
|
||||
DAVINCI_SYSMOD_VIRT(SYSMOD_PUPDCTL1));
|
||||
|
||||
mmcsd1_resources[0].start = DM365_MMCSD1_BASE;
|
||||
mmcsd1_resources[0].end = DM365_MMCSD1_BASE +
|
||||
SZ_4K - 1;
|
||||
mmcsd1_resources[2].start = DAVINCI_INTC_IRQ(
|
||||
IRQ_DM365_SDIOINT1);
|
||||
davinci_mmcsd1_device.name = "da830-mmc";
|
||||
} else
|
||||
break;
|
||||
|
||||
pdev = &davinci_mmcsd1_device;
|
||||
break;
|
||||
case 0:
|
||||
if (cpu_is_davinci_dm355()) {
|
||||
mmcsd0_resources[0].start = DM355_MMCSD0_BASE;
|
||||
mmcsd0_resources[0].end = DM355_MMCSD0_BASE + SZ_4K - 1;
|
||||
mmcsd0_resources[2].start = DAVINCI_INTC_IRQ(
|
||||
IRQ_DM355_SDIOINT0);
|
||||
|
||||
/* expose all 6 MMC0 signals: CLK, CMD, DATA[0..3] */
|
||||
davinci_cfg_reg(DM355_MMCSD0);
|
||||
|
||||
/* enable RX EDMA */
|
||||
davinci_cfg_reg(DM355_EVT26_MMC0_RX);
|
||||
} else if (cpu_is_davinci_dm365()) {
|
||||
mmcsd0_resources[0].start = DM365_MMCSD0_BASE;
|
||||
mmcsd0_resources[0].end = DM365_MMCSD0_BASE +
|
||||
SZ_4K - 1;
|
||||
mmcsd0_resources[2].start = DAVINCI_INTC_IRQ(
|
||||
IRQ_DM365_SDIOINT0);
|
||||
davinci_mmcsd0_device.name = "da830-mmc";
|
||||
} else if (cpu_is_davinci_dm644x()) {
|
||||
/* REVISIT: should this be in board-init code? */
|
||||
/* Power-on 3.3V IO cells */
|
||||
__raw_writel(0,
|
||||
DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
|
||||
/*Set up the pull regiter for MMC */
|
||||
davinci_cfg_reg(DM644X_MSTK);
|
||||
}
|
||||
|
||||
pdev = &davinci_mmcsd0_device;
|
||||
break;
|
||||
}
|
||||
|
||||
if (WARN_ON(!pdev))
|
||||
return;
|
||||
|
||||
pdev->dev.platform_data = config;
|
||||
platform_device_register(pdev);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
static struct resource wdt_resources[] = {
|
||||
{
|
||||
.start = DAVINCI_WDOG_BASE,
|
||||
.end = DAVINCI_WDOG_BASE + SZ_1K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device davinci_wdt_device = {
|
||||
.name = "davinci-wdt",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(wdt_resources),
|
||||
.resource = wdt_resources,
|
||||
};
|
||||
|
||||
int davinci_init_wdt(void)
|
||||
{
|
||||
return platform_device_register(&davinci_wdt_device);
|
||||
}
|
||||
|
||||
static struct platform_device davinci_gpio_device = {
|
||||
.name = "davinci_gpio",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
int davinci_gpio_register(struct resource *res, int size, void *pdata)
|
||||
{
|
||||
davinci_gpio_device.resource = res;
|
||||
davinci_gpio_device.num_resources = size;
|
||||
davinci_gpio_device.dev.platform_data = pdata;
|
||||
return platform_device_register(&davinci_gpio_device);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user