Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 138ab9f8 authored by Felipe Balbi's avatar Felipe Balbi Committed by Tony Lindgren
Browse files

ARM: OMAP1: Make omap1 use MMC multislot structures



Make omap1 use new MMC multislot structures. The related MMC
patches will be sent separately.

Signed-off-by: default avatarFelipe Balbi <felipe.lima@indt.org.br>
Signed-off-by: default avatarAnderson Briglia <anderson.briglia@indt.org.br>
Signed-off-by: default avatarCarlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: default avatarDavid Cohen <david.cohen@indt.org.br>
Signed-off-by: default avatarEduardo Valentin <eduardo.valentin@indt.org.br>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 6e2d4107
Loading
Loading
Loading
Loading
+57 −3
Original line number Diff line number Diff line
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -480,6 +516,10 @@ CONFIG_SMC91X=y
CONFIG_NETDEV_1000=y
CONFIG_NETDEV_10000=y

#
# Token Ring devices
#

#
# Wireless LAN
#
@@ -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

#
@@ -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
@@ -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
@@ -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

@@ -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

#
@@ -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
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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
+110 −0
Original line number Diff line number Diff line
/*
 * 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
+5 −5
Original line number Diff line number Diff line
@@ -392,12 +392,11 @@ static struct omap_mmc_config h2_mmc_config __initdata = {
	.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)),
};
@@ -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);
+114 −0
Original line number Diff line number Diff line
/*
 * linux/arch/arm/mach-omap1/board-h3-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 h3_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 h3_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode)
{
	int ret = 0;

#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;
	}

	/* Treated on upper level */

	return bus_mode;
}

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

	return slot_cover_open;
}

void h3_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 h3_mmc_late_init(struct device *dev)
{
	int ret = 0;

	mmc_device = dev;

	return ret;
}

static void h3_mmc_cleanup(struct device *dev)
{
}

static struct omap_mmc_platform_data h3_mmc_data = {
	.nr_slots                       = 1,
	.switch_slot                    = NULL,
	.init                           = h3_mmc_late_init,
	.cleanup                        = h3_mmc_cleanup,
	.slots[0]       = {
		.set_power              = h3_mmc_set_power,
		.set_bus_mode           = h3_mmc_set_bus_mode,
		.get_ro                 = NULL,
		.get_cover_state        = h3_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 h3_mmc_init(void)
{
	omap_set_mmc_info(1, &h3_mmc_data);
}

#else

void __init h3_mmc_init(void)
{
}

void h3_mmc_slot_cover_handler(void *arg, int state)
{
}
#endif
Loading