Skip to content

Commit

Permalink
ARM: OMAP1: Make omap1 use MMC multislot structures
Browse files Browse the repository at this point in the history
Make omap1 use new MMC multislot structures. The related MMC
patches will be sent separately.

Signed-off-by: Felipe Balbi <felipe.lima@indt.org.br>
Signed-off-by: Anderson Briglia <anderson.briglia@indt.org.br>
Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: David Cohen <david.cohen@indt.org.br>
Signed-off-by: Eduardo Valentin <eduardo.valentin@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Felipe Balbi authored and Tony Lindgren committed Feb 8, 2008
1 parent 6e2d410 commit 138ab9f
Show file tree
Hide file tree
Showing 9 changed files with 313 additions and 14 deletions.
60 changes: 57 additions & 3 deletions arch/arm/configs/omap_h2_1610_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,20 @@ CONFIG_SLAB=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0

#
# Loadable module support
#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
# CONFIG_KMOD is not set

#
# Block layer
#
CONFIG_BLOCK=y
# CONFIG_LBD is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
Expand Down Expand Up @@ -358,8 +366,20 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_INET6_TUNNEL is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set

#
# DCCP Configuration (EXPERIMENTAL)
#
# CONFIG_IP_DCCP is not set

#
# SCTP Configuration (EXPERIMENTAL)
#
# CONFIG_IP_SCTP is not set

#
# TIPC Configuration (EXPERIMENTAL)
#
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
Expand Down Expand Up @@ -408,6 +428,10 @@ CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_FW_LOADER is not set
# CONFIG_SYS_HYPERVISOR is not set

#
# Connector - unified userspace <-> kernelspace linker
#
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
# CONFIG_PARPORT is not set
Expand Down Expand Up @@ -463,7 +487,15 @@ CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_SCSI_DEBUG is not set
# CONFIG_ATA is not set

#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set

#
# Network device support
#
CONFIG_NETDEVICES=y
# CONFIG_NETDEVICES_MULTIQUEUE is not set
# CONFIG_DUMMY is not set
Expand All @@ -472,6 +504,10 @@ CONFIG_NETDEVICES=y
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
# CONFIG_PHYLIB is not set

#
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
# CONFIG_AX88796 is not set
Expand All @@ -480,6 +516,10 @@ CONFIG_SMC91X=y
CONFIG_NETDEV_1000=y
CONFIG_NETDEV_10000=y

#
# Token Ring devices
#

#
# Wireless LAN
#
Expand All @@ -505,6 +545,10 @@ CONFIG_SLHC=y
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set

#
# ISDN subsystem
#
# CONFIG_ISDN is not set

#
Expand Down Expand Up @@ -541,6 +585,7 @@ CONFIG_INPUT_MISC=y
# CONFIG_INPUT_POWERMATE is not set
# CONFIG_INPUT_YEALINK is not set
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_POLLDEV is not set

#
# Hardware I/O ports
Expand Down Expand Up @@ -575,6 +620,10 @@ CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
# CONFIG_LEGACY_PTYS is not set

#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_NOWAYOUT=y
Expand All @@ -588,6 +637,10 @@ CONFIG_WATCHDOG_NOWAYOUT=y
# CONFIG_NVRAM is not set
# CONFIG_R3964 is not set
# CONFIG_RAW_DRIVER is not set

#
# TPM devices
#
# CONFIG_TCG_TPM is not set
# CONFIG_I2C is not set

Expand Down Expand Up @@ -771,8 +824,9 @@ CONFIG_DNOTIFY=y
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
# CONFIG_VFAT_FS is not set
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
# CONFIG_NTFS_FS is not set

#
Expand Down Expand Up @@ -838,7 +892,7 @@ CONFIG_MSDOS_PARTITION=y
#
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
Expand All @@ -862,7 +916,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
# CONFIG_NLS_ISO8859_1 is not set
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-omap1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ obj-$(CONFIG_PM) += pm.o sleep.o
led-y := leds.o

# Specific board support
obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o
obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o board-h2-mmc.o
obj-$(CONFIG_MACH_OMAP_INNOVATOR) += board-innovator.o
obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
obj-$(CONFIG_MACH_OMAP_PERSEUS2) += board-perseus2.o
obj-$(CONFIG_MACH_OMAP_FSAMPLE) += board-fsample.o
obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o
obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o
obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o board-h3-mmc.o
obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o
obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o
obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o
Expand Down
110 changes: 110 additions & 0 deletions arch/arm/mach-omap1/board-h2-mmc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*
* linux/arch/arm/mach-omap1/board-h2-mmc.c
*
* Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT
* Author: Felipe Balbi <felipe.lima@indt.org.br>
*
* This code is based on linux/arch/arm/mach-omap2/board-n800-mmc.c, which is:
* Copyright (C) 2006 Nokia Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#include <asm/arch/mmc.h>
#include <asm/arch/gpio.h>

#ifdef CONFIG_MMC_OMAP
static int slot_cover_open;
static struct device *mmc_device;

static int h2_mmc_set_power(struct device *dev, int slot, int power_on,
int vdd)
{
#ifdef CONFIG_MMC_DEBUG
dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1,
power_on ? "on" : "off", vdd);
#endif
if (slot != 0) {
dev_err(dev, "No such slot %d\n", slot + 1);
return -ENODEV;
}

return 0;
}

static int h2_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode)
{
#ifdef CONFIG_MMC_DEBUG
dev_dbg(dev, "Set slot %d bus_mode %s\n", slot + 1,
bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull");
#endif
if (slot != 0) {
dev_err(dev, "No such slot %d\n", slot + 1);
return -ENODEV;
}

return 0;
}

static int h2_mmc_get_cover_state(struct device *dev, int slot)
{
BUG_ON(slot != 0);

return slot_cover_open;
}

void h2_mmc_slot_cover_handler(void *arg, int state)
{
if (mmc_device == NULL)
return;

slot_cover_open = state;
omap_mmc_notify_cover_event(mmc_device, 0, state);
}

static int h2_mmc_late_init(struct device *dev)
{
int ret = 0;

mmc_device = dev;

return ret;
}

static void h2_mmc_cleanup(struct device *dev)
{
}

static struct omap_mmc_platform_data h2_mmc_data = {
.nr_slots = 1,
.switch_slot = NULL,
.init = h2_mmc_late_init,
.cleanup = h2_mmc_cleanup,
.slots[0] = {
.set_power = h2_mmc_set_power,
.set_bus_mode = h2_mmc_set_bus_mode,
.get_ro = NULL,
.get_cover_state = h2_mmc_get_cover_state,
.ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 |
MMC_VDD_32_33 | MMC_VDD_33_34,
.name = "mmcblk",
},
};

void __init h2_mmc_init(void)
{
omap_set_mmc_info(1, &h2_mmc_data);
}

#else

void __init h2_mmc_init(void)
{
}

void h2_mmc_slot_cover_handler(void *arg, int state)
{
}
#endif
10 changes: 5 additions & 5 deletions arch/arm/mach-omap1/board-h2.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,14 @@ static struct omap_usb_config h2_usb_config __initdata = {
};

static struct omap_mmc_config h2_mmc_config __initdata = {
.mmc [0] = {
.enabled = 1,
.mmc[0] = {
.enabled = 1,
.wire4 = 1,
.wp_pin = OMAP_MPUIO(3),
.power_pin = -1, /* tps65010 gpio3 */
.switch_pin = OMAP_MPUIO(1),
},
};

extern struct omap_mmc_platform_data h2_mmc_data;

static struct omap_uart_config h2_uart_config __initdata = {
.enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
};
Expand Down Expand Up @@ -459,6 +458,7 @@ static void __init h2_init(void)
omap_board_config = h2_config;
omap_board_config_size = ARRAY_SIZE(h2_config);
omap_serial_init();
h2_mmc_init();

/* irq for tps65010 chip */
omap_cfg_reg(W4_GPIO58);
Expand Down
Loading

0 comments on commit 138ab9f

Please sign in to comment.