Commit 92633b72 authored by Russell King's avatar Russell King Committed by Russell King

Merge branches 'omap1-upstream' and 'omap2-upstream' into devel

This diff is collapsed.
This diff is collapsed.
...@@ -84,11 +84,39 @@ config MACH_OMAP_PALMTE ...@@ -84,11 +84,39 @@ config MACH_OMAP_PALMTE
bool "Palm Tungsten E" bool "Palm Tungsten E"
depends on ARCH_OMAP1 && ARCH_OMAP15XX depends on ARCH_OMAP1 && ARCH_OMAP15XX
help help
Support for the Palm Tungsten E PDA. Currently only the LCD panel Support for the Palm Tungsten E PDA. To boot the kernel, you'll
is supported. To boot the kernel, you'll need a PalmOS compatible need a PalmOS compatible bootloader; check out
bootloader; check out http://palmtelinux.sourceforge.net for more http://palmtelinux.sourceforge.net/ for more information.
information. Say Y here if you have this PDA model, say N otherwise.
Say Y here if you have such a PDA, say NO otherwise.
config MACH_OMAP_PALMZ71
bool "Palm Zire71"
depends on ARCH_OMAP1 && ARCH_OMAP15XX
help
Support for the Palm Zire71 PDA. To boot the kernel,
you'll need a PalmOS compatible bootloader; check out
http://hackndev.com/palm/z71 for more informations.
Say Y here if you have such a PDA, say N otherwise.
config MACH_OMAP_PALMTT
bool "Palm Tungsten|T"
depends on ARCH_OMAP1 && ARCH_OMAP15XX
help
Support for the Palm Tungsten|T PDA. To boot the kernel, you'll
need a PalmOS compatible bootloader (Garux); check out
http://www.hackndev.com/palm/tt/ for more information.
Say Y here if you have this PDA model, say N otherwise.
config MACH_SX1
bool "Siemens SX1"
depends on ARCH_OMAP1 && ARCH_OMAP15XX
help
Support for the Siemens SX1 phone. To boot the kernel,
you'll need a SX1 compatible bootloader; check out
http://forum.oslik.ru and
http://www.handhelds.org/moin/moin.cgi/SiemensSX1
for more information.
Say Y here if you have such a phone, say NO otherwise.
config MACH_NOKIA770 config MACH_NOKIA770
bool "Nokia 770" bool "Nokia 770"
......
...@@ -22,8 +22,11 @@ obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o ...@@ -22,8 +22,11 @@ obj-$(CONFIG_MACH_OMAP_OSK) += board-osk.o
obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o obj-$(CONFIG_MACH_OMAP_H3) += board-h3.o
obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o obj-$(CONFIG_MACH_VOICEBLUE) += board-voiceblue.o
obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o
obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o
obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o
obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o
obj-$(CONFIG_MACH_SX1) += board-sx1.o
ifeq ($(CONFIG_ARCH_OMAP15XX),y) ifeq ($(CONFIG_ARCH_OMAP15XX),y)
# Innovator-1510 FPGA # Innovator-1510 FPGA
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/input.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <asm/hardware.h> #include <asm/hardware.h>
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
#include <asm/arch/board-ams-delta.h> #include <asm/arch/board-ams-delta.h>
#include <asm/arch/gpio.h> #include <asm/arch/gpio.h>
#include <asm/arch/keypad.h>
#include <asm/arch/mux.h> #include <asm/arch/mux.h>
#include <asm/arch/usb.h> #include <asm/arch/usb.h>
#include <asm/arch/board.h> #include <asm/arch/board.h>
...@@ -31,6 +33,86 @@ ...@@ -31,6 +33,86 @@
static u8 ams_delta_latch1_reg; static u8 ams_delta_latch1_reg;
static u16 ams_delta_latch2_reg; static u16 ams_delta_latch2_reg;
static int ams_delta_keymap[] = {
KEY(0, 0, KEY_F1), /* Advert */
KEY(3, 0, KEY_COFFEE), /* Games */
KEY(2, 0, KEY_QUESTION), /* Directory */
KEY(3, 2, KEY_CONNECT), /* Internet */
KEY(2, 1, KEY_SHOP), /* Services */
KEY(1, 1, KEY_PHONE), /* VoiceMail */
KEY(1, 0, KEY_DELETE), /* Delete */
KEY(2, 2, KEY_PLAY), /* Play */
KEY(0, 1, KEY_PAGEUP), /* Up */
KEY(3, 1, KEY_PAGEDOWN), /* Down */
KEY(0, 2, KEY_EMAIL), /* ReadEmail */
KEY(1, 2, KEY_STOP), /* Stop */
/* Numeric keypad portion */
KEY(7, 0, KEY_KP1),
KEY(6, 0, KEY_KP2),
KEY(5, 0, KEY_KP3),
KEY(7, 1, KEY_KP4),
KEY(6, 1, KEY_KP5),
KEY(5, 1, KEY_KP6),
KEY(7, 2, KEY_KP7),
KEY(6, 2, KEY_KP8),
KEY(5, 2, KEY_KP9),
KEY(6, 3, KEY_KP0),
KEY(7, 3, KEY_KPASTERISK),
KEY(5, 3, KEY_KPDOT), /* # key */
KEY(2, 7, KEY_NUMLOCK), /* Mute */
KEY(1, 7, KEY_KPMINUS), /* Recall */
KEY(1, 6, KEY_KPPLUS), /* Redial */
KEY(6, 7, KEY_KPSLASH), /* Handsfree */
KEY(0, 6, KEY_ENTER), /* Video */
KEY(4, 7, KEY_CAMERA), /* Photo */
KEY(4, 0, KEY_F2), /* Home */
KEY(4, 1, KEY_F3), /* Office */
KEY(4, 2, KEY_F4), /* Mobile */
KEY(7, 7, KEY_F5), /* SMS */
KEY(5, 7, KEY_F6), /* Email */
/* QWERTY portion of keypad */
KEY(4, 3, KEY_Q),
KEY(3, 3, KEY_W),
KEY(2, 3, KEY_E),
KEY(1, 3, KEY_R),
KEY(0, 3, KEY_T),
KEY(7, 4, KEY_Y),
KEY(6, 4, KEY_U),
KEY(5, 4, KEY_I),
KEY(4, 4, KEY_O),
KEY(3, 4, KEY_P),
KEY(2, 4, KEY_A),
KEY(1, 4, KEY_S),
KEY(0, 4, KEY_D),
KEY(7, 5, KEY_F),
KEY(6, 5, KEY_G),
KEY(5, 5, KEY_H),
KEY(4, 5, KEY_J),
KEY(3, 5, KEY_K),
KEY(2, 5, KEY_L),
KEY(1, 5, KEY_Z),
KEY(0, 5, KEY_X),
KEY(7, 6, KEY_C),
KEY(6, 6, KEY_V),
KEY(5, 6, KEY_B),
KEY(4, 6, KEY_N),
KEY(3, 6, KEY_M),
KEY(2, 6, KEY_SPACE),
KEY(0, 7, KEY_LEFTSHIFT), /* Vol up */
KEY(3, 7, KEY_LEFTCTRL), /* Vol down */
0
};
void ams_delta_latch1_write(u8 mask, u8 value) void ams_delta_latch1_write(u8 mask, u8 value)
{ {
ams_delta_latch1_reg &= ~mask; ams_delta_latch1_reg &= ~mask;
...@@ -76,6 +158,10 @@ static struct map_desc ams_delta_io_desc[] __initdata = { ...@@ -76,6 +158,10 @@ static struct map_desc ams_delta_io_desc[] __initdata = {
} }
}; };
static struct omap_lcd_config ams_delta_lcd_config __initdata = {
.ctrl_name = "internal",
};
static struct omap_uart_config ams_delta_uart_config __initdata = { static struct omap_uart_config ams_delta_uart_config __initdata = {
.enabled_uarts = 1, .enabled_uarts = 1,
}; };
...@@ -87,16 +173,50 @@ static struct omap_usb_config ams_delta_usb_config __initdata = { ...@@ -87,16 +173,50 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
}; };
static struct omap_board_config_kernel ams_delta_config[] = { static struct omap_board_config_kernel ams_delta_config[] = {
{ OMAP_TAG_LCD, &ams_delta_lcd_config },
{ OMAP_TAG_UART, &ams_delta_uart_config }, { OMAP_TAG_UART, &ams_delta_uart_config },
{ OMAP_TAG_USB, &ams_delta_usb_config }, { OMAP_TAG_USB, &ams_delta_usb_config },
}; };
static struct resource ams_delta_kp_resources[] = {
[0] = {
.start = INT_KEYBOARD,
.end = INT_KEYBOARD,
.flags = IORESOURCE_IRQ,
},
};
static struct omap_kp_platform_data ams_delta_kp_data = {
.rows = 8,
.cols = 8,
.keymap = ams_delta_keymap,
.keymapsize = ARRAY_SIZE(ams_delta_keymap),
.delay = 9,
};
static struct platform_device ams_delta_kp_device = {
.name = "omap-keypad",
.id = -1,
.dev = {
.platform_data = &ams_delta_kp_data,
},
.num_resources = ARRAY_SIZE(ams_delta_kp_resources),
.resource = ams_delta_kp_resources,
};
static struct platform_device ams_delta_lcd_device = {
.name = "lcd_ams_delta",
.id = -1,
};
static struct platform_device ams_delta_led_device = { static struct platform_device ams_delta_led_device = {
.name = "ams-delta-led", .name = "ams-delta-led",
.id = -1 .id = -1
}; };
static struct platform_device *ams_delta_devices[] __initdata = { static struct platform_device *ams_delta_devices[] __initdata = {
&ams_delta_kp_device,
&ams_delta_lcd_device,
&ams_delta_led_device, &ams_delta_led_device,
}; };
......
...@@ -139,6 +139,66 @@ static struct platform_device h2_nor_device = { ...@@ -139,6 +139,66 @@ static struct platform_device h2_nor_device = {
.resource = &h2_nor_resource, .resource = &h2_nor_resource,
}; };
#if 0 /* REVISIT: Enable when nand_platform_data is applied */
static struct mtd_partition h2_nand_partitions[] = {
#if 0
/* REVISIT: enable these partitions if you make NAND BOOT
* work on your H2 (rev C or newer); published versions of
* x-load only support P2 and H3.
*/
{
.name = "xloader",
.offset = 0,
.size = 64 * 1024,
.mask_flags = MTD_WRITEABLE, /* force read-only */
},
{
.name = "bootloader",
.offset = MTDPART_OFS_APPEND,
.size = 256 * 1024,
.mask_flags = MTD_WRITEABLE, /* force read-only */
},
{
.name = "params",
.offset = MTDPART_OFS_APPEND,
.size = 192 * 1024,
},
{
.name = "kernel",
.offset = MTDPART_OFS_APPEND,
.size = 2 * SZ_1M,
},
#endif
{
.name = "filesystem",
.size = MTDPART_SIZ_FULL,
.offset = MTDPART_OFS_APPEND,
},
};
/* dip switches control NAND chip access: 8 bit, 16 bit, or neither */
static struct nand_platform_data h2_nand_data = {
.options = NAND_SAMSUNG_LP_OPTIONS,
.parts = h2_nand_partitions,
.nr_parts = ARRAY_SIZE(h2_nand_partitions),
};
static struct resource h2_nand_resource = {
.flags = IORESOURCE_MEM,
};
static struct platform_device h2_nand_device = {
.name = "omapnand",
.id = 0,
.dev = {
.platform_data = &h2_nand_data,
},
.num_resources = 1,
.resource = &h2_nand_resource,
};
#endif
static struct resource h2_smc91x_resources[] = { static struct resource h2_smc91x_resources[] = {
[0] = { [0] = {
.start = OMAP1610_ETHR_START, /* Physical */ .start = OMAP1610_ETHR_START, /* Physical */
...@@ -218,11 +278,15 @@ static struct resource h2_irda_resources[] = { ...@@ -218,11 +278,15 @@ static struct resource h2_irda_resources[] = {
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
}; };
static u64 irda_dmamask = 0xffffffff;
static struct platform_device h2_irda_device = { static struct platform_device h2_irda_device = {
.name = "omapirda", .name = "omapirda",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &h2_irda_data, .platform_data = &h2_irda_data,
.dma_mask = &irda_dmamask,
}, },
.num_resources = ARRAY_SIZE(h2_irda_resources), .num_resources = ARRAY_SIZE(h2_irda_resources),
.resource = h2_irda_resources, .resource = h2_irda_resources,
...@@ -270,6 +334,7 @@ static struct platform_device h2_mcbsp1_device = { ...@@ -270,6 +334,7 @@ static struct platform_device h2_mcbsp1_device = {
static struct platform_device *h2_devices[] __initdata = { static struct platform_device *h2_devices[] __initdata = {
&h2_nor_device, &h2_nor_device,
//&h2_nand_device,
&h2_smc91x_device, &h2_smc91x_device,
&h2_irda_device, &h2_irda_device,
&h2_kp_device, &h2_kp_device,
...@@ -333,6 +398,13 @@ static struct omap_board_config_kernel h2_config[] __initdata = { ...@@ -333,6 +398,13 @@ static struct omap_board_config_kernel h2_config[] __initdata = {
{ OMAP_TAG_LCD, &h2_lcd_config }, { OMAP_TAG_LCD, &h2_lcd_config },
}; };
#define H2_NAND_RB_GPIO_PIN 62
static int h2_nand_dev_ready(struct nand_platform_data *data)
{
return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN);
}
static void __init h2_init(void) static void __init h2_init(void)
{ {
/* Here we assume the NOR boot config: NOR on CS3 (possibly swapped /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
...@@ -347,6 +419,13 @@ static void __init h2_init(void) ...@@ -347,6 +419,13 @@ static void __init h2_init(void)
h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys();
h2_nor_resource.end += SZ_32M - 1; h2_nor_resource.end += SZ_32M - 1;
#if 0 /* REVISIT: Enable when nand_platform_data is applied */
h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS;
h2_nand_resource.end += SZ_4K - 1;
if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN)))
h2_nand_data.dev_ready = h2_nand_dev_ready;
#endif
omap_cfg_reg(L3_1610_FLASH_CS2B_OE); omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
omap_cfg_reg(M8_1610_FLASH_CS2B_WE); omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include <asm/arch/keypad.h> #include <asm/arch/keypad.h>
#include <asm/arch/dma.h> #include <asm/arch/dma.h>
#include <asm/arch/common.h> #include <asm/arch/common.h>
#include <asm/arch/mcbsp.h>
#include <asm/arch/omap-alsa.h>
extern int omap_gpio_init(void); extern int omap_gpio_init(void);
...@@ -351,11 +353,14 @@ static struct resource h3_irda_resources[] = { ...@@ -351,11 +353,14 @@ static struct resource h3_irda_resources[] = {
}, },
}; };
static u64 irda_dmamask = 0xffffffff;
static struct platform_device h3_irda_device = { static struct platform_device h3_irda_device = {
.name = "omapirda", .name = "omapirda",
.id = 0, .id = 0,
.dev = { .dev = {
.platform_data = &h3_irda_data, .platform_data = &h3_irda_data,
.dma_mask = &irda_dmamask,
}, },
.num_resources = ARRAY_SIZE(h3_irda_resources), .num_resources = ARRAY_SIZE(h3_irda_resources),
.resource = h3_irda_resources, .resource = h3_irda_resources,
...@@ -366,6 +371,41 @@ static struct platform_device h3_lcd_device = { ...@@ -366,6 +371,41 @@ static struct platform_device h3_lcd_device = {
.id = -1, .id = -1,
}; };
static struct omap_mcbsp_reg_cfg mcbsp_regs = {
.spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
.spcr1 = RINTM(3) | RRST,
.rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(1),
.rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
.xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(1) | XFIG,
.xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
.srgr1 = FWID(15),
.srgr2 = GSYNC | CLKSP | FSGM | FPER(31),
.pcr0 = CLKRM | SCLKME | FSXP | FSRP | CLKXP | CLKRP,
//.pcr0 = CLKXP | CLKRP, /* mcbsp: slave */
};
static struct omap_alsa_codec_config alsa_config = {
.name = "H3 TSC2101",
.mcbsp_regs_alsa = &mcbsp_regs,
.codec_configure_dev = NULL, // tsc2101_configure,
.codec_set_samplerate = NULL, // tsc2101_set_samplerate,
.codec_clock_setup = NULL, // tsc2101_clock_setup,
.codec_clock_on = NULL, // tsc2101_clock_on,
.codec_clock_off = NULL, // tsc2101_clock_off,
.get_default_samplerate = NULL, // tsc2101_get_default_samplerate,
};
static struct platform_device h3_mcbsp1_device = {
.name = "omap_alsa_mcbsp",
.id = 1,
.dev = {
.platform_data = &alsa_config,
},
};
static struct platform_device *devices[] __initdata = { static struct platform_device *devices[] __initdata = {
&nor_device, &nor_device,
&nand_device, &nand_device,
...@@ -374,6 +414,7 @@ static struct platform_device *devices[] __initdata = { ...@@ -374,6 +414,7 @@ static struct platform_device *devices[] __initdata = {
&h3_irda_device, &h3_irda_device,
&h3_kp_device, &h3_kp_device,
&h3_lcd_device, &h3_lcd_device,
&h3_mcbsp1_device,
}; };
static struct omap_usb_config h3_usb_config __initdata = { static struct omap_usb_config h3_usb_config __initdata = {
......
...@@ -33,6 +33,12 @@ ...@@ -33,6 +33,12 @@
#include <asm/arch/dsp_common.h> #include <asm/arch/dsp_common.h>
#include <asm/arch/aic23.h> #include <asm/arch/aic23.h>
#include <asm/arch/gpio.h> #include <asm/arch/gpio.h>
#include <asm/arch/omapfb.h>
#include <asm/arch/lcd_mipid.h>
#include "../plat-omap/dsp/dsp_common.h"
#define ADS7846_PENDOWN_GPIO 15
static void __init omap_nokia770_init_irq(void) static void __init omap_nokia770_init_irq(void)
{ {
...@@ -94,6 +100,41 @@ static struct platform_device *nokia770_devices[] __initdata = { ...@@ -94,6 +100,41 @@ static struct platform_device *nokia770_devices[] __initdata = {
&nokia770_kp_device, &nokia770_kp_device,
}; };
static void mipid_shutdown(struct mipid_platform_data *pdata)
{
if (pdata->nreset_gpio != -1) {
printk(KERN_INFO "shutdown LCD\n");
omap_set_gpio_dataout(pdata->nreset_gpio, 0);
msleep(120);
}
}
static struct mipid_platform_data nokia770_mipid_platform_data = {
.shutdown = mipid_shutdown,
};
static void mipid_dev_init(void)
{
const struct omap_lcd_config *conf;
conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
if (conf != NULL) {
nokia770_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
nokia770_mipid_platform_data.data_lines = conf->data_lines;
}
}
static void ads7846_dev_init(void)
{
if (omap_request_gpio(ADS7846_PENDOWN_GPIO) < 0)
printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
}
static int ads7846_get_pendown_state(void)
{
return !omap_get_gpio_datain(ADS7846_PENDOWN_GPIO);
}
static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
.x_max = 0x0fff, .x_max = 0x0fff,
.y_max = 0x0fff, .y_max = 0x0fff,
...@@ -101,6 +142,8 @@ static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = ...@@ -101,6 +142,8 @@ static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata =
.pressure_max = 255, .pressure_max = 255,
.debounce_max = 10, .debounce_max = 10,
.debounce_tol = 3, .debounce_tol = 3,
.debounce_rep = 1,
.get_pendown_state = ads7846_get_pendown_state,
}; };
static struct spi_board_info nokia770_spi_board_info[] __initdata = { static struct spi_board_info nokia770_spi_board_info[] __initdata = {
...@@ -109,6 +152,7 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = { ...@@ -109,6 +152,7 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = {
.bus_num = 2, .bus_num = 2,
.chip_select = 3, .chip_select = 3,
.max_speed_hz = 12000000, .max_speed_hz = 12000000,
.platform_data = &nokia770_mipid_platform_data,
}, },
[1] = { [1] = {
.modalias = "ads7846", .modalias = "ads7846",
...@@ -153,6 +197,7 @@ static struct omap_board_config_kernel nokia770_config[] = { ...@@ -153,6 +197,7 @@ static struct omap_board_config_kernel nokia770_config[] = {
{ OMAP_TAG_MMC, &nokia770_mmc_config }, { OMAP_TAG_MMC, &nokia770_mmc_config },
}; };
#if defined(CONFIG_OMAP_DSP)
/* /*
* audio power control * audio power control
*/ */
...@@ -183,7 +228,7 @@ static void nokia770_audio_pwr_up(void) ...@@ -183,7 +228,7 @@ static void nokia770_audio_pwr_up(void)
clk_enable(dspxor_ck); clk_enable(dspxor_ck);
/* Turn on codec */ /* Turn on codec */
tlv320aic23_power_up(); aic23_power_up();
if (omap_get_gpio_datain(HEADPHONE_GPIO)) if (omap_get_gpio_datain(HEADPHONE_GPIO))
/* HP not connected, turn on amplifier */ /* HP not connected, turn on amplifier */
...@@ -197,7 +242,7 @@ static void codec_delayed_power_down(struct work_struct *work) ...@@ -197,7 +242,7 @@ static void codec_delayed_power_down(struct work_struct *work)
{ {
down(&audio_pwr_sem); down(&audio_pwr_sem);
if (audio_pwr_state == -1) if (audio_pwr_state == -1)
tlv320aic23_power_down(); aic23_power_down();
clk_disable(dspxor_ck); clk_disable(dspxor_ck);
up(&audio_pwr_sem); up(&audio_pwr_sem);
} }
...@@ -213,7 +258,8 @@ static void nokia770_audio_pwr_down(void) ...@@ -213,7 +258,8 @@ static void nokia770_audio_pwr_down(void)
schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */
} }
void nokia770_audio_pwr_up_request(int stage) static int
nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage)
{ {
down(&audio_pwr_sem); down(&audio_pwr_sem);
if (audio_pwr_state == -1) if (audio_pwr_state == -1)
...@@ -221,9 +267,11 @@ void nokia770_audio_pwr_up_request(int stage) ...@@ -221,9 +267,11 @@ void nokia770_audio_pwr_up_request(int stage)
/* force audio_pwr_state = 0, even if it was 1. */ /* force audio_pwr_state = 0, even if it was 1. */
audio_pwr_state = 0; audio_pwr_state = 0;
up(&audio_pwr_sem); up(&audio_pwr_sem);
return 0;
} }
void nokia770_audio_pwr_down_request(int stage) static int
nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage)
{ {
down(&audio_pwr_sem); down(&audio_pwr_sem);
switch (stage) { switch (stage) {
...@@ -239,8 +287,39 @@ void nokia770_audio_pwr_down_request(int stage) ...@@ -239,8 +287,39 @@ void nokia770_audio_pwr_down_request(int stage)
break; break;
} }
up(&audio_pwr_sem); up(&audio_pwr_sem);
return 0;
} }
static struct dsp_kfunc_device nokia770_audio_device = {
.name = "audio",
.type = DSP_KFUNC_DEV_TYPE_AUDIO,
.enable = nokia770_audio_pwr_up_request,
.disable = nokia770_audio_pwr_down_request,
};
static __init int omap_dsp_init(void)
{
int ret;
dspxor_ck = clk_get(0, "dspxor_ck");
if (IS_ERR(dspxor_ck)) {
printk(KERN_ERR "couldn't acquire dspxor_ck\n");
return PTR_ERR(dspxor_ck);
}
ret = dsp_kfunc_device_register(&nokia770_audio_device);
if (ret) {
printk(KERN_ERR
"KFUNC device registration faild: %s\n",
nokia770_audio_device.name);
goto out;
}
return 0;
out:
return ret;
}
#endif /* CONFIG_OMAP_DSP */
static void __init omap_nokia770_init(void) static void __init omap_nokia770_init(void)
{ {
nokia770_config[0].data = &nokia770_usb_config; nokia770_config[0].data = &nokia770_usb_config;
...@@ -250,10 +329,11 @@ static void __init omap_nokia770_init(void) ...@@ -250,10 +329,11 @@ static void __init omap_nokia770_init(void)
ARRAY_SIZE(nokia770_spi_board_info)); ARRAY_SIZE(nokia770_spi_board_info));
omap_board_config = nokia770_config; omap_board_config = nokia770_config;
omap_board_config_size = ARRAY_SIZE(nokia770_config); omap_board_config_size = ARRAY_SIZE(nokia770_config);
omap_gpio_init();
omap_serial_init(); omap_serial_init();
omap_dsp_audio_pwr_up_request = nokia770_audio_pwr_up_request; omap_dsp_init();
omap_dsp_audio_pwr_down_request = nokia770_audio_pwr_down_request; ads7846_dev_init();
dspxor_ck = clk_get(0, "dspxor_ck"); mipid_dev_init();
} }
static void __init omap_nokia770_map_io(void) static void __init omap_nokia770_map_io(void)
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -292,6 +293,18 @@ static struct platform_device osk5912_kp_device = { ...@@ -292,6 +293,18 @@ static struct platform_device osk5912_kp_device = {
.resource = osk5912_kp_resources, .resource = osk5912_kp_resources,
}; };
static struct omap_backlight_config mistral_bl_data = {
.default_intensity = 0xa0,
};
static struct platform_device mistral_bl_device = {
.name = "omap-bl",
.id = -1,
.dev = {
.platform_data = &mistral_bl_data,
},
};
static struct platform_device osk5912_lcd_device = { static struct platform_device osk5912_lcd_device = {
.name = "lcd_osk", .name = "lcd_osk",
.id = -1, .id = -1,
...@@ -299,6 +312,7 @@ static struct platform_device osk5912_lcd_device = { ...@@ -299,6 +312,7 @@ static struct platform_device osk5912_lcd_device = {
static struct platform_device *mistral_devices[] __initdata = { static struct platform_device *mistral_devices[] __initdata = {
&osk5912_kp_device, &osk5912_kp_device,
&mistral_bl_device,
&osk5912_lcd_device, &osk5912_lcd_device,
}; };
...@@ -342,6 +356,38 @@ static void __init osk_mistral_init(void) ...@@ -342,6 +356,38 @@ static void __init osk_mistral_init(void)
* can't talk to the ads or even the i2c eeprom. * can't talk to the ads or even the i2c eeprom.
*/ */
/* parallel camera interface */
omap_cfg_reg(J15_1610_CAM_LCLK);
omap_cfg_reg(J18_1610_CAM_D7);
omap_cfg_reg(J19_1610_CAM_D6);
omap_cfg_reg(J14_1610_CAM_D5);
omap_cfg_reg(K18_1610_CAM_D4);
omap_cfg_reg(K19_1610_CAM_D3);
omap_cfg_reg(K15_1610_CAM_D2);
omap_cfg_reg(K14_1610_CAM_D1);
omap_cfg_reg(L19_1610_CAM_D0);
omap_cfg_reg(L18_1610_CAM_VS);
omap_cfg_reg(L15_1610_CAM_HS);
omap_cfg_reg(M19_1610_CAM_RSTZ);
omap_cfg_reg(Y15_1610_CAM_OUTCLK);
/* serial camera interface */
omap_cfg_reg(H19_1610_CAM_EXCLK);
omap_cfg_reg(W13_1610_CCP_CLKM);
omap_cfg_reg(Y12_1610_CCP_CLKP);
/* CCP_DATAM CONFLICTS WITH UART1.TX (and serial console) */
// omap_cfg_reg(Y14_1610_CCP_DATAM);
omap_cfg_reg(W14_1610_CCP_DATAP);
/* CAM_PWDN */
if (omap_request_gpio(11) == 0) {
omap_cfg_reg(N20_1610_GPIO11);
omap_set_gpio_direction(11, 0 /* out */);
omap_set_gpio_dataout(11, 0 /* off */);
} else
pr_debug("OSK+Mistral: CAM_PWDN is awol\n");
// omap_cfg_reg(P19_1610_GPIO6); // BUSY // omap_cfg_reg(P19_1610_GPIO6); // BUSY
omap_cfg_reg(P20_1610_GPIO4); // PENIRQ omap_cfg_reg(P20_1610_GPIO4); // PENIRQ
set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING); set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING);
...@@ -372,6 +418,15 @@ static void __init osk_mistral_init(void) ...@@ -372,6 +418,15 @@ static void __init osk_mistral_init(void)
} else } else
printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n"); printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");
/* LCD: backlight, and power; power controls other devices on the
* board, like the touchscreen, EEPROM, and wakeup (!) switch.
*/
omap_cfg_reg(PWL);
if (omap_request_gpio(2) == 0) {
omap_set_gpio_direction(2, 0 /* out */);
omap_set_gpio_dataout(2, 1 /* on */);
}
platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices)); platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));
} }
#else #else
......
This diff is collapsed.
/*
* linux/arch/arm/mach-omap1/board-palmtt.c
*
* Modified from board-palmtt2.c
*
* Modified and amended for Palm Tungsten|T
* by Marek Vasut <marek.vasut@gmail.com>
*
* 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 <linux/delay.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/notifier.h>
#include <linux/clk.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/leds.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/flash.h>
#include <asm/arch/led.h>
#include <asm/arch/mcbsp.h>
#include <asm/arch/gpio.h>
#include <asm/arch/mux.h>
#include <asm/arch/usb.h>
#include <asm/arch/dma.h>
#include <asm/arch/tc.h>
#include <asm/arch/board.h>
#include <asm/arch/irda.h>
#include <asm/arch/keypad.h>
#include <asm/arch/common.h>
#include <asm/arch/omap-alsa.h>
#include <linux/input.h>
#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>
static int palmtt_keymap[] = {
KEY(0, 0, KEY_ESC),
KEY(0, 1, KEY_SPACE),
KEY(0, 2, KEY_LEFTCTRL),
KEY(0, 3, KEY_TAB),
KEY(0, 4, KEY_ENTER),
KEY(1, 0, KEY_LEFT),
KEY(1, 1, KEY_DOWN),
KEY(1, 2, KEY_UP),
KEY(1, 3, KEY_RIGHT),
KEY(2, 0, KEY_SLEEP),
KEY(2, 4, KEY_Y),
0
};
static struct mtd_partition palmtt_partitions[] = {
{
.name = "write8k",
.offset = 0,
.size = SZ_8K,
.mask_flags = 0,
},
{
.name = "PalmOS-BootLoader(ro)",
.offset = SZ_8K,
.size = 7 * SZ_8K,
.mask_flags = MTD_WRITEABLE,
},
{
.name = "u-boot",
.offset = MTDPART_OFS_APPEND,
.size = 8 * SZ_8K,
.mask_flags = 0,
},
{
.name = "PalmOS-FS(ro)",
.offset = MTDPART_OFS_APPEND,
.size = 7 * SZ_1M + 4 * SZ_64K - 16 * SZ_8K,
.mask_flags = MTD_WRITEABLE,
},
{
.name = "u-boot(rez)",
.offset = MTDPART_OFS_APPEND,
.size = SZ_128K,
.mask_flags = 0
},
{
.name = "empty",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
.mask_flags = 0
}
};
static struct flash_platform_data palmtt_flash_data = {
.map_name = "cfi_probe",
.width = 2,
.parts = palmtt_partitions,
.nr_parts = ARRAY_SIZE(palmtt_partitions),
};
static struct resource palmtt_flash_resource = {
.start = OMAP_CS0_PHYS,
.end = OMAP_CS0_PHYS + SZ_8M - 1,
.flags = IORESOURCE_MEM,
};
static struct platform_device palmtt_flash_device = {
.name = "omapflash",
.id = 0,
.dev = {
.platform_data = &palmtt_flash_data,
},
.num_resources = 1,
.resource = &palmtt_flash_resource,
};
#define DEFAULT_BITPERSAMPLE 16
static struct omap_mcbsp_reg_cfg mcbsp_regs = {
.spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
.spcr1 = RINTM(3) | RRST,
.rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(0),
.rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) |
RWDLEN1(OMAP_MCBSP_WORD_16),
.xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(0) | XFIG,
.xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) |
XWDLEN1(OMAP_MCBSP_WORD_16),
.srgr1 = FWID(DEFAULT_BITPERSAMPLE - 1),
.srgr2 = GSYNC | CLKSP | FSGM |
FPER(DEFAULT_BITPERSAMPLE * 2 - 1),
.pcr0 = CLKXP | CLKRP, /* mcbsp: slave */
};
static struct omap_alsa_codec_config alsa_config = {
.name = "PalmTT AIC23",
.mcbsp_regs_alsa = &mcbsp_regs,
.codec_configure_dev = NULL, // aic23_configure,
.codec_set_samplerate = NULL, // aic23_set_samplerate,
.codec_clock_setup = NULL, // aic23_clock_setup,
.codec_clock_on = NULL, // aic23_clock_on,
.codec_clock_off = NULL, // aic23_clock_off,
.get_default_samplerate = NULL, // aic23_get_default_samplerate,
};
static struct platform_device palmtt_mcbsp1_device = {
.name = "omap_alsa_mcbsp",
.id = 1,
.dev = {
.platform_data = &alsa_config,
},
};
static struct resource palmtt_kp_resources[] = {
[0] = {
.start = INT_KEYBOARD,
.end = INT_KEYBOARD,
.flags = IORESOURCE_IRQ,
},
};
static struct omap_kp_platform_data palmtt_kp_data = {
.rows = 6,
.cols = 3,
.keymap = palmtt_keymap,
};
static struct platform_device palmtt_kp_device = {
.name = "omap-keypad",
.id = -1,
.dev = {
.platform_data = &palmtt_kp_data,
},
.num_resources = ARRAY_SIZE(palmtt_kp_resources),
.resource = palmtt_kp_resources,
};
static struct platform_device palmtt_lcd_device = {
.name = "lcd_palmtt",
.id = -1,
};
static struct omap_irda_config palmtt_irda_config = {
.transceiver_cap = IR_SIRMODE,
.rx_channel = OMAP_DMA_UART3_RX,
.tx_channel = OMAP_DMA_UART3_TX,
.dest_start = UART3_THR,
.src_start = UART3_RHR,
.tx_trigger = 0,
.rx_trigger = 0,
};
static struct resource palmtt_irda_resources[] = {
[0] = {
.start = INT_UART3,
.end = INT_UART3,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device palmtt_irda_device = {
.name = "omapirda",
.id = -1,
.dev = {
.platform_data = &palmtt_irda_config,
},
.num_resources = ARRAY_SIZE(palmtt_irda_resources),
.resource = palmtt_irda_resources,
};
static struct platform_device palmtt_spi_device = {
.name = "spi_palmtt",
.id = -1,
};
static struct omap_backlight_config palmtt_backlight_config = {
.default_intensity = 0xa0,
};
static struct platform_device palmtt_backlight_device = {
.name = "omap-bl",
.id = -1,
.dev = {
.platform_data= &palmtt_backlight_config,
},
};
static struct omap_led_config palmtt_led_config[] = {
{
.cdev = {
.name = "palmtt:led0",
},
.gpio = PALMTT_LED_GPIO,
},
};
static struct omap_led_platform_data palmtt_led_data = {
.nr_leds = ARRAY_SIZE(palmtt_led_config),
.leds = palmtt_led_config,
};
static struct platform_device palmtt_led_device = {
.name = "omap-led",
.id = -1,
.dev = {
.platform_data = &palmtt_led_data,
},
};
static struct platform_device *palmtt_devices[] __initdata = {
&palmtt_flash_device,
&palmtt_mcbsp1_device,
&palmtt_kp_device,
&palmtt_lcd_device,
&palmtt_irda_device,
&palmtt_spi_device,
&palmtt_backlight_device,
&palmtt_led_device,
};
static int palmtt_get_pendown_state(void)
{
return !omap_get_gpio_datain(6);
}
static const struct ads7846_platform_data palmtt_ts_info = {
.model = 7846,
.vref_delay_usecs = 100, /* internal, no capacitor */
.x_plate_ohms = 419,
.y_plate_ohms = 486,
.get_pendown_state = palmtt_get_pendown_state,
};
static struct spi_board_info __initdata palmtt_boardinfo[] = {
{
/* MicroWire (bus 2) CS0 has an ads7846e */
.modalias = "ads7846",
.platform_data = &palmtt_ts_info,
.irq = OMAP_GPIO_IRQ(6),
.max_speed_hz = 120000 /* max sample rate at 3V */
* 26 /* command + data + overhead */,
.bus_num = 2,
.chip_select = 0,
}
};
static void __init omap_palmtt_init_irq(void)
{
omap1_init_common_hw();
omap_init_irq();
}
static struct omap_usb_config palmtt_usb_config __initdata = {
.register_dev = 1,
.hmc_mode = 0,
.pins[0] = 2,
};
static struct omap_lcd_config palmtt_lcd_config __initdata = {
.ctrl_name = "internal",
};
static struct omap_uart_config palmtt_uart_config __initdata = {
.enabled_uarts = (1 << 0) | (1 << 1) | (0 << 2),
};
static struct omap_board_config_kernel palmtt_config[] = {
{ OMAP_TAG_USB, &palmtt_usb_config },
{ OMAP_TAG_LCD, &palmtt_lcd_config },
{ OMAP_TAG_UART, &palmtt_uart_config },
};
static void __init omap_mpu_wdt_mode(int mode) {
if (mode)
omap_writew(0x8000, OMAP_WDT_TIMER_MODE);
else {
omap_writew(0x00f5, OMAP_WDT_TIMER_MODE);
omap_writew(0x00a0, OMAP_WDT_TIMER_MODE);
}
}
static void __init omap_palmtt_init(void)
{
omap_mpu_wdt_mode(0);
omap_board_config = palmtt_config;
omap_board_config_size = ARRAY_SIZE(palmtt_config);
platform_add_devices(palmtt_devices, ARRAY_SIZE(palmtt_devices));
spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo));
omap_serial_init();
}
static void __init omap_palmtt_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
.phys_io = 0xfff00000,
.io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
.boot_params = 0x10000100,
.map_io = omap_palmtt_map_io,
.init_irq = omap_palmtt_init_irq,
.init_machine = omap_palmtt_init,
.timer = &omap_timer,
MACHINE_END
/*
* linux/arch/arm/mach-omap1/board-palmz71.c
*
* Modified from board-generic.c
*
* Support for the Palm Zire71 PDA.
*
* Original version : Laurent Gonzalez
*
* Modified for zire71 : Marek Vasut
*
* 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 <linux/delay.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/notifier.h>
#include <linux/clk.h>
#include <linux/irq.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/flash.h>
#include <asm/arch/mcbsp.h>
#include <asm/arch/gpio.h>
#include <asm/arch/mux.h>
#include <asm/arch/usb.h>
#include <asm/arch/dma.h>
#include <asm/arch/tc.h>
#include <asm/arch/board.h>
#include <asm/arch/irda.h>
#include <asm/arch/keypad.h>
#include <asm/arch/common.h>
#include <asm/arch/omap-alsa.h>
#include <linux/input.h>
#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>
static void __init
omap_palmz71_init_irq(void)
{
omap1_init_common_hw();
omap_init_irq();
omap_gpio_init();
}
static int palmz71_keymap[] = {
KEY(0, 0, KEY_F1),
KEY(0, 1, KEY_F2),
KEY(0, 2, KEY_F3),
KEY(0, 3, KEY_F4),
KEY(0, 4, KEY_POWER),
KEY(1, 0, KEY_LEFT),
KEY(1, 1, KEY_DOWN),
KEY(1, 2, KEY_UP),
KEY(1, 3, KEY_RIGHT),
KEY(1, 4, KEY_CENTER),
KEY(2, 0, KEY_CAMERA),
0,
};
static struct omap_kp_platform_data palmz71_kp_data = {
.rows = 8,
.cols = 8,
.keymap = palmz71_keymap,
.rep = 1,
.delay = 80,
};
static struct resource palmz71_kp_resources[] = {
[0] = {
.start = INT_KEYBOARD,
.end = INT_KEYBOARD,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device palmz71_kp_device = {
.name = "omap-keypad",
.id = -1,
.dev = {
.platform_data = &palmz71_kp_data,
},
.num_resources = ARRAY_SIZE(palmz71_kp_resources),
.resource = palmz71_kp_resources,
};
static struct mtd_partition palmz71_rom_partitions[] = {
/* PalmOS "Small ROM", contains the bootloader and the debugger */
{
.name = "smallrom",
.offset = 0,
.size = 0xa000,
.mask_flags = MTD_WRITEABLE,
},
/* PalmOS "Big ROM", a filesystem with all the OS code and data */
{
.name = "bigrom",
.offset = SZ_128K,
/*
* 0x5f0000 bytes big in the multi-language ("EFIGS") version,
* 0x7b0000 bytes in the English-only ("enUS") version.
*/
.size = 0x7b0000,
.mask_flags = MTD_WRITEABLE,
},
};
static struct flash_platform_data palmz71_rom_data = {
.map_name = "map_rom",
.name = "onboardrom",
.width = 2,
.parts = palmz71_rom_partitions,
.nr_parts = ARRAY_SIZE(palmz71_rom_partitions),
};
static struct resource palmz71_rom_resource = {
.start = OMAP_CS0_PHYS,
.end = OMAP_CS0_PHYS + SZ_8M - 1,
.flags = IORESOURCE_MEM,
};
static struct platform_device palmz71_rom_device = {
.name = "omapflash",
.id = -1,
.dev = {
.platform_data = &palmz71_rom_data,
},
.num_resources = 1,
.resource = &palmz71_rom_resource,
};
static struct platform_device palmz71_lcd_device = {
.name = "lcd_palmz71",
.id = -1,
};
static struct omap_irda_config palmz71_irda_config = {
.transceiver_cap = IR_SIRMODE,
.rx_channel = OMAP_DMA_UART3_RX,
.tx_channel = OMAP_DMA_UART3_TX,
.dest_start = UART3_THR,
.src_start = UART3_RHR,
.tx_trigger = 0,
.rx_trigger = 0,
};
static struct resource palmz71_irda_resources[] = {
[0] = {
.start = INT_UART3,
.end = INT_UART3,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device palmz71_irda_device = {
.name = "omapirda",
.id = -1,
.dev = {
.platform_data = &palmz71_irda_config,
},
.num_resources = ARRAY_SIZE(palmz71_irda_resources),
.resource = palmz71_irda_resources,
};
static struct platform_device palmz71_spi_device = {
.name = "spi_palmz71",
.id = -1,
};
#define DEFAULT_BITPERSAMPLE 16
static struct omap_mcbsp_reg_cfg mcbsp_regs = {
.spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
.spcr1 = RINTM(3) | RRST,
.rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(0),
.rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
.xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(0) | XFIG,
.xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
.srgr1 = FWID(DEFAULT_BITPERSAMPLE - 1),
.srgr2 = GSYNC | CLKSP | FSGM | FPER(DEFAULT_BITPERSAMPLE * 2 - 1),
.pcr0 = CLKXP | CLKRP, /* mcbsp: slave */
};
static struct omap_alsa_codec_config alsa_config = {
.name = "PalmZ71 AIC23",
.mcbsp_regs_alsa = &mcbsp_regs,
.codec_configure_dev = NULL, /* aic23_configure */
.codec_set_samplerate = NULL, /* aic23_set_samplerate */
.codec_clock_setup = NULL, /* aic23_clock_setup */
.codec_clock_on = NULL, /* aic23_clock_on */
.codec_clock_off = NULL, /* aic23_clock_off */
.get_default_samplerate = NULL, /* aic23_get_default_samplerate */
};
static struct platform_device palmz71_mcbsp1_device = {
.name = "omap_alsa_mcbsp",
.id = 1,
.dev = {
.platform_data = &alsa_config,
},
};
static struct omap_backlight_config palmz71_backlight_config = {
.default_intensity = 0xa0,
};
static struct platform_device palmz71_backlight_device = {
.name = "omap-bl",
.id = -1,
.dev = {
.platform_data = &palmz71_backlight_config,
},
};
static struct platform_device *devices[] __initdata = {
&palmz71_rom_device,
&palmz71_kp_device,
&palmz71_mcbsp1_device,
&palmz71_lcd_device,
&palmz71_irda_device,
&palmz71_spi_device,
&palmz71_backlight_device,
};
static int
palmz71_get_pendown_state(void)
{
return !omap_get_gpio_datain(PALMZ71_PENIRQ_GPIO);
}
static const struct ads7846_platform_data palmz71_ts_info = {
.model = 7846,
.vref_delay_usecs = 100, /* internal, no capacitor */
.x_plate_ohms = 419,
.y_plate_ohms = 486,
.get_pendown_state = palmz71_get_pendown_state,
};
static struct spi_board_info __initdata palmz71_boardinfo[] = { {
/* MicroWire (bus 2) CS0 has an ads7846e */
.modalias = "ads7846",
.platform_data = &palmz71_ts_info,
.irq = OMAP_GPIO_IRQ(PALMZ71_PENIRQ_GPIO),
.max_speed_hz = 120000 /* max sample rate at 3V */
* 26 /* command + data + overhead */,
.bus_num = 2,
.chip_select = 0,
} };
static struct omap_usb_config palmz71_usb_config __initdata = {
.register_dev = 1, /* Mini-B only receptacle */
.hmc_mode = 0,
.pins[0] = 2,
};
static struct omap_mmc_config palmz71_mmc_config __initdata = {
.mmc[0] = {
.enabled = 1,
.wire4 = 0,
.wp_pin = PALMZ71_MMC_WP_GPIO,
.power_pin = -1,
.switch_pin = PALMZ71_MMC_IN_GPIO,
},
};
static struct omap_lcd_config palmz71_lcd_config __initdata = {
.ctrl_name = "internal",
};
static struct omap_uart_config palmz71_uart_config __initdata = {
.enabled_uarts = (1 << 0) | (1 << 1) | (0 << 2),
};
static struct omap_board_config_kernel palmz71_config[] = {
{OMAP_TAG_USB, &palmz71_usb_config},
{OMAP_TAG_MMC, &palmz71_mmc_config},
{OMAP_TAG_LCD, &palmz71_lcd_config},
{OMAP_TAG_UART, &palmz71_uart_config},
};
static irqreturn_t
palmz71_powercable(int irq, void *dev_id)
{
if (omap_get_gpio_datain(PALMZ71_USBDETECT_GPIO)) {
printk(KERN_INFO "PM: Power cable connected\n");
set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO),
IRQT_FALLING);
} else {
printk(KERN_INFO "PM: Power cable disconnected\n");
set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO),
IRQT_RISING);
}
return IRQ_HANDLED;
}
static void __init
omap_mpu_wdt_mode(int mode)
{
if (mode)
omap_writew(0x8000, OMAP_WDT_TIMER_MODE);
else {
omap_writew(0x00f5, OMAP_WDT_TIMER_MODE);
omap_writew(0x00a0, OMAP_WDT_TIMER_MODE);
}
}
static void __init
palmz71_gpio_setup(int early)
{
if (early) {
/* Only set GPIO1 so we have a working serial */
omap_set_gpio_dataout(1, 1);
omap_set_gpio_direction(1, 0);
} else {
/* Set MMC/SD host WP pin as input */
if (omap_request_gpio(PALMZ71_MMC_WP_GPIO)) {
printk(KERN_ERR "Could not reserve WP GPIO!\n");
return;
}
omap_set_gpio_direction(PALMZ71_MMC_WP_GPIO, 1);
/* Monitor the Power-cable-connected signal */
if (omap_request_gpio(PALMZ71_USBDETECT_GPIO)) {
printk(KERN_ERR
"Could not reserve cable signal GPIO!\n");
return;
}
omap_set_gpio_direction(PALMZ71_USBDETECT_GPIO, 1);
if (request_irq(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO),
palmz71_powercable, IRQF_SAMPLE_RANDOM,
"palmz71-cable", 0))
printk(KERN_ERR
"IRQ request for power cable failed!\n");
palmz71_powercable(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 0);
}
}
static void __init
omap_palmz71_init(void)
{
palmz71_gpio_setup(1);
omap_mpu_wdt_mode(0);
omap_board_config = palmz71_config;
omap_board_config_size = ARRAY_SIZE(palmz71_config);
platform_add_devices(devices, ARRAY_SIZE(devices));
spi_register_board_info(palmz71_boardinfo,
ARRAY_SIZE(palmz71_boardinfo));
omap_serial_init();
palmz71_gpio_setup(0);
}
static void __init
omap_palmz71_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
.phys_io = 0xfff00000,
.io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
.boot_params = 0x10000100,.map_io = omap_palmz71_map_io,
.init_irq = omap_palmz71_init_irq,
.init_machine = omap_palmz71_init,
.timer = &omap_timer,
MACHINE_END
This diff is collapsed.
...@@ -235,7 +235,7 @@ static struct notifier_block panic_block = { ...@@ -235,7 +235,7 @@ static struct notifier_block panic_block = {
static int __init voiceblue_setup(void) static int __init voiceblue_setup(void)
{ {
/* Setup panic notifier */ /* Setup panic notifier */
notifier_chain_register(&panic_notifier_list, &panic_block); atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
return 0; return 0;
} }
......
...@@ -49,6 +49,15 @@ static void omap1_uart_recalc(struct clk * clk) ...@@ -49,6 +49,15 @@ static void omap1_uart_recalc(struct clk * clk)
clk->rate = 12000000; clk->rate = 12000000;
} }
static void omap1_sossi_recalc(struct clk *clk)
{
u32 div = omap_readl(MOD_CONF_CTRL_1);
div = (div >> 17) & 0x7;
div++;
clk->rate = clk->parent->rate / div;
}
static int omap1_clk_enable_dsp_domain(struct clk *clk) static int omap1_clk_enable_dsp_domain(struct clk *clk)
{ {
int retval; int retval;
...@@ -396,6 +405,31 @@ static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate) ...@@ -396,6 +405,31 @@ static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate)
return 0; return 0;
} }
static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate)
{
u32 l;
int div;
unsigned long p_rate;
p_rate = clk->parent->rate;
/* Round towards slower frequency */
div = (p_rate + rate - 1) / rate;
div--;
if (div < 0 || div > 7)
return -EINVAL;
l = omap_readl(MOD_CONF_CTRL_1);
l &= ~(7 << 17);
l |= div << 17;
omap_writel(l, MOD_CONF_CTRL_1);
clk->rate = p_rate / (div + 1);
if (unlikely(clk->flags & RATE_PROPAGATES))
propagate_rate(clk);
return 0;
}
static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate) static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate)
{ {
return 96000000 / calc_ext_dsor(rate); return 96000000 / calc_ext_dsor(rate);
......
...@@ -17,6 +17,8 @@ static int omap1_clk_enable_generic(struct clk * clk); ...@@ -17,6 +17,8 @@ static int omap1_clk_enable_generic(struct clk * clk);
static void omap1_clk_disable_generic(struct clk * clk); static void omap1_clk_disable_generic(struct clk * clk);
static void omap1_ckctl_recalc(struct clk * clk); static void omap1_ckctl_recalc(struct clk * clk);
static void omap1_watchdog_recalc(struct clk * clk); static void omap1_watchdog_recalc(struct clk * clk);
static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate);
static void omap1_sossi_recalc(struct clk *clk);
static void omap1_ckctl_recalc_dsp_domain(struct clk * clk); static void omap1_ckctl_recalc_dsp_domain(struct clk * clk);
static int omap1_clk_enable_dsp_domain(struct clk * clk); static int omap1_clk_enable_dsp_domain(struct clk * clk);
static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate); static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate);
...@@ -170,7 +172,8 @@ static struct arm_idlect1_clk ck_dpll1out = { ...@@ -170,7 +172,8 @@ static struct arm_idlect1_clk ck_dpll1out = {
.clk = { .clk = {
.name = "ck_dpll1out", .name = "ck_dpll1out",
.parent = &ck_dpll1, .parent = &ck_dpll1,
.flags = CLOCK_IN_OMAP16XX | CLOCK_IDLE_CONTROL, .flags = CLOCK_IN_OMAP16XX | CLOCK_IDLE_CONTROL |
ENABLE_REG_32BIT | RATE_PROPAGATES,
.enable_reg = (void __iomem *)ARM_IDLECT2, .enable_reg = (void __iomem *)ARM_IDLECT2,
.enable_bit = EN_CKOUT_ARM, .enable_bit = EN_CKOUT_ARM,
.recalc = &followparent_recalc, .recalc = &followparent_recalc,
...@@ -180,6 +183,19 @@ static struct arm_idlect1_clk ck_dpll1out = { ...@@ -180,6 +183,19 @@ static struct arm_idlect1_clk ck_dpll1out = {
.idlect_shift = 12, .idlect_shift = 12,
}; };
static struct clk sossi_ck = {
.name = "ck_sossi",
.parent = &ck_dpll1out.clk,
.flags = CLOCK_IN_OMAP16XX | CLOCK_NO_IDLE_PARENT |
ENABLE_REG_32BIT,
.enable_reg = (void __iomem *)MOD_CONF_CTRL_1,
.enable_bit = 16,
.recalc = &omap1_sossi_recalc,
.set_rate = &omap1_set_sossi_rate,
.enable = &omap1_clk_enable_generic,
.disable = &omap1_clk_disable_generic,
};
static struct clk arm_ck = { static struct clk arm_ck = {
.name = "arm_ck", .name = "arm_ck",
.parent = &ck_dpll1, .parent = &ck_dpll1,
...@@ -282,7 +298,7 @@ static struct clk arminth_ck16xx = { ...@@ -282,7 +298,7 @@ static struct clk arminth_ck16xx = {
static struct clk dsp_ck = { static struct clk dsp_ck = {
.name = "dsp_ck", .name = "dsp_ck",
.parent = &ck_dpll1, .parent = &ck_dpll1,
.flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
RATE_CKCTL, RATE_CKCTL,
.enable_reg = (void __iomem *)ARM_CKCTL, .enable_reg = (void __iomem *)ARM_CKCTL,
.enable_bit = EN_DSPCK, .enable_bit = EN_DSPCK,
...@@ -295,7 +311,7 @@ static struct clk dsp_ck = { ...@@ -295,7 +311,7 @@ static struct clk dsp_ck = {
static struct clk dspmmu_ck = { static struct clk dspmmu_ck = {
.name = "dspmmu_ck", .name = "dspmmu_ck",
.parent = &ck_dpll1, .parent = &ck_dpll1,
.flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
RATE_CKCTL | ALWAYS_ENABLED, RATE_CKCTL | ALWAYS_ENABLED,
.rate_offset = CKCTL_DSPMMUDIV_OFFSET, .rate_offset = CKCTL_DSPMMUDIV_OFFSET,
.recalc = &omap1_ckctl_recalc, .recalc = &omap1_ckctl_recalc,
...@@ -306,7 +322,7 @@ static struct clk dspmmu_ck = { ...@@ -306,7 +322,7 @@ static struct clk dspmmu_ck = {
static struct clk dspper_ck = { static struct clk dspper_ck = {
.name = "dspper_ck", .name = "dspper_ck",
.parent = &ck_dpll1, .parent = &ck_dpll1,
.flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
RATE_CKCTL | VIRTUAL_IO_ADDRESS, RATE_CKCTL | VIRTUAL_IO_ADDRESS,
.enable_reg = (void __iomem *)DSP_IDLECT2, .enable_reg = (void __iomem *)DSP_IDLECT2,
.enable_bit = EN_PERCK, .enable_bit = EN_PERCK,
...@@ -320,7 +336,7 @@ static struct clk dspper_ck = { ...@@ -320,7 +336,7 @@ static struct clk dspper_ck = {
static struct clk dspxor_ck = { static struct clk dspxor_ck = {
.name = "dspxor_ck", .name = "dspxor_ck",
.parent = &ck_ref, .parent = &ck_ref,
.flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
VIRTUAL_IO_ADDRESS, VIRTUAL_IO_ADDRESS,
.enable_reg = (void __iomem *)DSP_IDLECT2, .enable_reg = (void __iomem *)DSP_IDLECT2,
.enable_bit = EN_XORPCK, .enable_bit = EN_XORPCK,
...@@ -332,7 +348,7 @@ static struct clk dspxor_ck = { ...@@ -332,7 +348,7 @@ static struct clk dspxor_ck = {
static struct clk dsptim_ck = { static struct clk dsptim_ck = {
.name = "dsptim_ck", .name = "dsptim_ck",
.parent = &ck_ref, .parent = &ck_ref,
.flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
VIRTUAL_IO_ADDRESS, VIRTUAL_IO_ADDRESS,
.enable_reg = (void __iomem *)DSP_IDLECT2, .enable_reg = (void __iomem *)DSP_IDLECT2,
.enable_bit = EN_DSPTIMCK, .enable_bit = EN_DSPTIMCK,
...@@ -374,7 +390,7 @@ static struct clk arminth_ck1510 = { ...@@ -374,7 +390,7 @@ static struct clk arminth_ck1510 = {
static struct clk tipb_ck = { static struct clk tipb_ck = {
/* No-idle controlled by "tc_ck" */ /* No-idle controlled by "tc_ck" */
.name = "tibp_ck", .name = "tipb_ck",
.parent = &tc_ck.clk, .parent = &tc_ck.clk,
.flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 |
ALWAYS_ENABLED, ALWAYS_ENABLED,
...@@ -733,7 +749,7 @@ remains active during MPU idle whenever this is enabled */ ...@@ -733,7 +749,7 @@ remains active during MPU idle whenever this is enabled */
static struct clk i2c_fck = { static struct clk i2c_fck = {
.name = "i2c_fck", .name = "i2c_fck",
.id = 1, .id = 1,
.flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
VIRTUAL_CLOCK | CLOCK_NO_IDLE_PARENT | VIRTUAL_CLOCK | CLOCK_NO_IDLE_PARENT |
ALWAYS_ENABLED, ALWAYS_ENABLED,
.parent = &armxor_ck.clk, .parent = &armxor_ck.clk,
...@@ -760,6 +776,7 @@ static struct clk * onchip_clks[] = { ...@@ -760,6 +776,7 @@ static struct clk * onchip_clks[] = {
&ck_dpll1, &ck_dpll1,
/* CK_GEN1 clocks */ /* CK_GEN1 clocks */
&ck_dpll1out.clk, &ck_dpll1out.clk,
&sossi_ck,
&arm_ck, &arm_ck,
&armper_ck.clk, &armper_ck.clk,
&arm_gpio_ck, &arm_gpio_ck,
......
...@@ -283,6 +283,30 @@ MUX_CFG("R11_1610_CF_IOIS16", B, 0, 3, 2, 16, 1, 2, 1, 1) ...@@ -283,6 +283,30 @@ MUX_CFG("R11_1610_CF_IOIS16", B, 0, 3, 2, 16, 1, 2, 1, 1)
MUX_CFG("V10_1610_CF_IREQ", A, 24, 3, 2, 14, 0, 2, 0, 1) MUX_CFG("V10_1610_CF_IREQ", A, 24, 3, 2, 14, 0, 2, 0, 1)
MUX_CFG("W10_1610_CF_RESET", A, 18, 3, 2, 12, 1, 2, 1, 1) MUX_CFG("W10_1610_CF_RESET", A, 18, 3, 2, 12, 1, 2, 1, 1)
MUX_CFG("W11_1610_CF_CD1", 10, 15, 3, 3, 8, 1, 3, 1, 1) MUX_CFG("W11_1610_CF_CD1", 10, 15, 3, 3, 8, 1, 3, 1, 1)
/* parallel camera */
MUX_CFG("J15_1610_CAM_LCLK", 4, 24, 0, 0, 18, 1, 0, 0, 0)
MUX_CFG("J18_1610_CAM_D7", 4, 27, 0, 0, 19, 1, 0, 0, 0)
MUX_CFG("J19_1610_CAM_D6", 5, 0, 0, 0, 20, 1, 0, 0, 0)
MUX_CFG("J14_1610_CAM_D5", 5, 3, 0, 0, 21, 1, 0, 0, 0)
MUX_CFG("K18_1610_CAM_D4", 5, 6, 0, 0, 22, 1, 0, 0, 0)
MUX_CFG("K19_1610_CAM_D3", 5, 9, 0, 0, 23, 1, 0, 0, 0)
MUX_CFG("K15_1610_CAM_D2", 5, 12, 0, 0, 24, 1, 0, 0, 0)
MUX_CFG("K14_1610_CAM_D1", 5, 15, 0, 0, 25, 1, 0, 0, 0)
MUX_CFG("L19_1610_CAM_D0", 5, 18, 0, 0, 26, 1, 0, 0, 0)
MUX_CFG("L18_1610_CAM_VS", 5, 21, 0, 0, 27, 1, 0, 0, 0)
MUX_CFG("L15_1610_CAM_HS", 5, 24, 0, 0, 28, 1, 0, 0, 0)
MUX_CFG("M19_1610_CAM_RSTZ", 5, 27, 0, 0, 29, 0, 0, 0, 0)
MUX_CFG("Y15_1610_CAM_OUTCLK", A, 0, 6, 2, 6, 0, 2, 0, 0)
/* serial camera */
MUX_CFG("H19_1610_CAM_EXCLK", 4, 21, 0, 0, 17, 0, 0, 0, 0)
/* REVISIT 5912 spec sez CCP_* can't pullup or pulldown ... ? */
MUX_CFG("Y12_1610_CCP_CLKP", 8, 18, 6, 1, 24, 1, 1, 0, 0)
MUX_CFG("W13_1610_CCP_CLKM", 9, 0, 6, 1, 28, 1, 1, 0, 0)
MUX_CFG("W14_1610_CCP_DATAP", 9, 24, 6, 2, 4, 1, 2, 0, 0)
MUX_CFG("Y14_1610_CCP_DATAM", 9, 21, 6, 2, 3, 1, 2, 0, 0)
}; };
#endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */ #endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */
......
...@@ -153,11 +153,8 @@ void omap_pm_idle(void) ...@@ -153,11 +153,8 @@ void omap_pm_idle(void)
use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1); use_idlect1 = omap_dm_timer_modify_idlect_mask(use_idlect1);
#endif #endif
if (omap_dma_running()) { if (omap_dma_running())
use_idlect1 &= ~(1 << 6); use_idlect1 &= ~(1 << 6);
if (omap_lcd_dma_ext_running())
use_idlect1 &= ~(1 << 12);
}
/* We should be able to remove the do_sleep variable and multiple /* We should be able to remove the do_sleep variable and multiple
* tests above as soon as drivers, timer and DMA code have been fixed. * tests above as soon as drivers, timer and DMA code have been fixed.
......
...@@ -11,6 +11,10 @@ config ARCH_OMAP2420 ...@@ -11,6 +11,10 @@ config ARCH_OMAP2420
select OMAP_DM_TIMER select OMAP_DM_TIMER
select ARCH_OMAP_OTG select ARCH_OMAP_OTG
config ARCH_OMAP2430
bool "OMAP2430 support"
depends on ARCH_OMAP24XX
comment "OMAP Board Type" comment "OMAP Board Type"
depends on ARCH_OMAP2 depends on ARCH_OMAP2
...@@ -21,8 +25,13 @@ config MACH_OMAP_GENERIC ...@@ -21,8 +25,13 @@ config MACH_OMAP_GENERIC
config MACH_OMAP_H4 config MACH_OMAP_H4
bool "OMAP 2420 H4 board" bool "OMAP 2420 H4 board"
depends on ARCH_OMAP2 && ARCH_OMAP24XX depends on ARCH_OMAP2 && ARCH_OMAP24XX
select OMAP_DEBUG_LEDS if LEDS || LEDS_OMAP_DEBUG select OMAP_DEBUG_DEVICES
config MACH_OMAP_APOLLON config MACH_OMAP_APOLLON
bool "OMAP 2420 Apollon board" bool "OMAP 2420 Apollon board"
depends on ARCH_OMAP2 && ARCH_OMAP24XX depends on ARCH_OMAP2 && ARCH_OMAP24XX
config MACH_OMAP_2430SDP
bool "OMAP 2430 SDP board"
depends on ARCH_OMAP2 && ARCH_OMAP24XX
...@@ -14,5 +14,6 @@ obj-$(CONFIG_PM) += pm.o pm-domain.o sleep.o ...@@ -14,5 +14,6 @@ obj-$(CONFIG_PM) += pm.o pm-domain.o sleep.o
# Specific board support # Specific board support
obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
/*
* linux/arch/arm/mach-omap2/board-2430sdp.c
*
* Copyright (C) 2006 Texas Instruments
*
* Modified from mach-omap2/board-generic.c
*
* Initial Code : Based on a patch from Komal Shah and Richard Woodruff
* Updated the Code for 2430 SDP : Syed Mohammed Khasim
*
* 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 <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/flash.h>
#include <asm/arch/gpio.h>
#include <asm/arch/mux.h>
#include <asm/arch/board.h>
#include <asm/arch/common.h>
#include <asm/arch/gpmc.h>
#include "prcm-regs.h"
#include <asm/io.h>
#define SDP2430_FLASH_CS 0
#define SDP2430_SMC91X_CS 5
static struct mtd_partition sdp2430_partitions[] = {
/* bootloader (U-Boot, etc) in first sector */
{
.name = "bootloader",
.offset = 0,
.size = SZ_256K,
.mask_flags = MTD_WRITEABLE, /* force read-only */
},
/* bootloader params in the next sector */
{
.name = "params",
.offset = MTDPART_OFS_APPEND,
.size = SZ_128K,
.mask_flags = 0,
},
/* kernel */
{
.name = "kernel",
.offset = MTDPART_OFS_APPEND,
.size = SZ_2M,
.mask_flags = 0
},
/* file system */
{
.name = "filesystem",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
.mask_flags = 0
}
};
static struct flash_platform_data sdp2430_flash_data = {
.map_name = "cfi_probe",
.width = 2,
.parts = sdp2430_partitions,
.nr_parts = ARRAY_SIZE(sdp2430_partitions),
};
static struct resource sdp2430_flash_resource = {
.start = SDP2430_CS0_BASE,
.end = SDP2430_CS0_BASE + SZ_64M - 1,
.flags = IORESOURCE_MEM,
};
static struct platform_device sdp2430_flash_device = {
.name = "omapflash",
.id = 0,
.dev = {
.platform_data = &sdp2430_flash_data,
},
.num_resources = 1,
.resource = &sdp2430_flash_resource,
};
static struct resource sdp2430_smc91x_resources[] = {
[0] = {
.start = SDP2430_CS0_BASE,
.end = SDP2430_CS0_BASE + SZ_64M - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
.end = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device sdp2430_smc91x_device = {
.name = "smc91x",
.id = -1,
.num_resources = ARRAY_SIZE(sdp2430_smc91x_resources),
.resource = sdp2430_smc91x_resources,
};
static struct platform_device *sdp2430_devices[] __initdata = {
&sdp2430_smc91x_device,
&sdp2430_flash_device,
};
static inline void __init sdp2430_init_smc91x(void)
{
int eth_cs;
unsigned long cs_mem_base;
unsigned int rate;
struct clk *l3ck;
eth_cs = SDP2430_SMC91X_CS;
l3ck = clk_get(NULL, "core_l3_ck");
if (IS_ERR(l3ck))
rate = 100000000;
else
rate = clk_get_rate(l3ck);
/* Make sure CS1 timings are correct, for 2430 always muxed */
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, 0x00011200);
if (rate >= 160000000) {
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
} else if (rate >= 130000000) {
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
} else { /* rate = 100000000 */
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F);
gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000003C2);
}
if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
return;
}
sdp2430_smc91x_resources[0].start = cs_mem_base + 0x300;
sdp2430_smc91x_resources[0].end = cs_mem_base + 0x30f;
udelay(100);
if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ) < 0) {
printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
OMAP24XX_ETHR_GPIO_IRQ);
gpmc_cs_free(eth_cs);
return;
}
omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1);
}
static void __init omap_2430sdp_init_irq(void)
{
omap2_init_common_hw();
omap_init_irq();
omap_gpio_init();
sdp2430_init_smc91x();
}
static struct omap_uart_config sdp2430_uart_config __initdata = {
.enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
};
static struct omap_board_config_kernel sdp2430_config[] = {
{OMAP_TAG_UART, &sdp2430_uart_config},
};
static void __init omap_2430sdp_init(void)
{
platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
omap_board_config = sdp2430_config;
omap_board_config_size = ARRAY_SIZE(sdp2430_config);
omap_serial_init();
}
static void __init omap_2430sdp_map_io(void)
{
omap2_map_common_io();
}
MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
/* Maintainer: Syed Khasim - Texas Instruments Inc */
.phys_io = 0x48000000,
.io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
.boot_params = 0x80000100,
.map_io = omap_2430sdp_map_io,
.init_irq = omap_2430sdp_init_irq,
.init_machine = omap_2430sdp_init,
.timer = &omap_timer,
MACHINE_END
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/leds.h>
#include <linux/irq.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -32,10 +34,12 @@ ...@@ -32,10 +34,12 @@
#include <asm/mach/flash.h> #include <asm/mach/flash.h>
#include <asm/arch/gpio.h> #include <asm/arch/gpio.h>
#include <asm/arch/led.h>
#include <asm/arch/mux.h> #include <asm/arch/mux.h>
#include <asm/arch/usb.h> #include <asm/arch/usb.h>
#include <asm/arch/board.h> #include <asm/arch/board.h>
#include <asm/arch/common.h> #include <asm/arch/common.h>
#include <asm/arch/gpmc.h>
#include "prcm-regs.h" #include "prcm-regs.h"
/* LED & Switch macros */ /* LED & Switch macros */
...@@ -46,6 +50,9 @@ ...@@ -46,6 +50,9 @@
#define SW_UP_GPIO17 17 #define SW_UP_GPIO17 17
#define SW_DOWN_GPIO58 58 #define SW_DOWN_GPIO58 58
#define APOLLON_FLASH_CS 0
#define APOLLON_ETH_CS 1
static struct mtd_partition apollon_partitions[] = { static struct mtd_partition apollon_partitions[] = {
{ {
.name = "X-Loader + U-Boot", .name = "X-Loader + U-Boot",
...@@ -85,10 +92,10 @@ static struct flash_platform_data apollon_flash_data = { ...@@ -85,10 +92,10 @@ static struct flash_platform_data apollon_flash_data = {
.nr_parts = ARRAY_SIZE(apollon_partitions), .nr_parts = ARRAY_SIZE(apollon_partitions),
}; };
static struct resource apollon_flash_resource = { static struct resource apollon_flash_resource[] = {
.start = APOLLON_CS0_BASE, [0] = {
.end = APOLLON_CS0_BASE + SZ_128K,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
},
}; };
static struct platform_device apollon_onenand_device = { static struct platform_device apollon_onenand_device = {
...@@ -97,14 +104,24 @@ static struct platform_device apollon_onenand_device = { ...@@ -97,14 +104,24 @@ static struct platform_device apollon_onenand_device = {
.dev = { .dev = {
.platform_data = &apollon_flash_data, .platform_data = &apollon_flash_data,
}, },
.num_resources = ARRAY_SIZE(&apollon_flash_resource), .num_resources = ARRAY_SIZE(apollon_flash_resource),
.resource = &apollon_flash_resource, .resource = apollon_flash_resource,
}; };
static void __init apollon_flash_init(void)
{
unsigned long base;
if (gpmc_cs_request(APOLLON_FLASH_CS, SZ_128K, &base) < 0) {
printk(KERN_ERR "Cannot request OneNAND GPMC CS\n");
return;
}
apollon_flash_resource[0].start = base;
apollon_flash_resource[0].end = base + SZ_128K - 1;
}
static struct resource apollon_smc91x_resources[] = { static struct resource apollon_smc91x_resources[] = {
[0] = { [0] = {
.start = APOLLON_ETHR_START, /* Physical */
.end = APOLLON_ETHR_START + 0xf,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -126,14 +143,51 @@ static struct platform_device apollon_lcd_device = { ...@@ -126,14 +143,51 @@ static struct platform_device apollon_lcd_device = {
.id = -1, .id = -1,
}; };
static struct omap_led_config apollon_led_config[] = {
{
.cdev = {
.name = "apollon:led0",
},
.gpio = LED0_GPIO13,
},
{
.cdev = {
.name = "apollon:led1",
},
.gpio = LED1_GPIO14,
},
{
.cdev = {
.name = "apollon:led2",
},
.gpio = LED2_GPIO15,
},
};
static struct omap_led_platform_data apollon_led_data = {
.nr_leds = ARRAY_SIZE(apollon_led_config),
.leds = apollon_led_config,
};
static struct platform_device apollon_led_device = {
.name = "omap-led",
.id = -1,
.dev = {
.platform_data = &apollon_led_data,
},
};
static struct platform_device *apollon_devices[] __initdata = { static struct platform_device *apollon_devices[] __initdata = {
&apollon_onenand_device, &apollon_onenand_device,
&apollon_smc91x_device, &apollon_smc91x_device,
&apollon_lcd_device, &apollon_lcd_device,
&apollon_led_device,
}; };
static inline void __init apollon_init_smc91x(void) static inline void __init apollon_init_smc91x(void)
{ {
unsigned long base;
/* Make sure CS1 timings are correct */ /* Make sure CS1 timings are correct */
GPMC_CONFIG1_1 = 0x00011203; GPMC_CONFIG1_1 = 0x00011203;
GPMC_CONFIG2_1 = 0x001f1f01; GPMC_CONFIG2_1 = 0x001f1f01;
...@@ -141,13 +195,20 @@ static inline void __init apollon_init_smc91x(void) ...@@ -141,13 +195,20 @@ static inline void __init apollon_init_smc91x(void)
GPMC_CONFIG4_1 = 0x1c091c09; GPMC_CONFIG4_1 = 0x1c091c09;
GPMC_CONFIG5_1 = 0x041f1f1f; GPMC_CONFIG5_1 = 0x041f1f1f;
GPMC_CONFIG6_1 = 0x000004c4; GPMC_CONFIG6_1 = 0x000004c4;
GPMC_CONFIG7_1 = 0x00000f40 | (APOLLON_CS1_BASE >> 24);
if (gpmc_cs_request(APOLLON_ETH_CS, SZ_16M, &base) < 0) {
printk(KERN_ERR "Failed to request GPMC CS for smc91x\n");
return;
}
apollon_smc91x_resources[0].start = base + 0x300;
apollon_smc91x_resources[0].end = base + 0x30f;
udelay(100); udelay(100);
omap_cfg_reg(W4__24XX_GPIO74); omap_cfg_reg(W4__24XX_GPIO74);
if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ) < 0) { if (omap_request_gpio(APOLLON_ETHR_GPIO_IRQ) < 0) {
printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
APOLLON_ETHR_GPIO_IRQ); APOLLON_ETHR_GPIO_IRQ);
gpmc_cs_free(APOLLON_ETH_CS);
return; return;
} }
omap_set_gpio_direction(APOLLON_ETHR_GPIO_IRQ, 1); omap_set_gpio_direction(APOLLON_ETHR_GPIO_IRQ, 1);
...@@ -175,6 +236,13 @@ static struct omap_mmc_config apollon_mmc_config __initdata = { ...@@ -175,6 +236,13 @@ static struct omap_mmc_config apollon_mmc_config __initdata = {
}, },
}; };
static struct omap_usb_config apollon_usb_config __initdata = {
.register_dev = 1,
.hmc_mode = 0x14, /* 0:dev 1:host1 2:disable */
.pins[0] = 6,
};
static struct omap_lcd_config apollon_lcd_config __initdata = { static struct omap_lcd_config apollon_lcd_config __initdata = {
.ctrl_name = "internal", .ctrl_name = "internal",
}; };
...@@ -182,6 +250,7 @@ static struct omap_lcd_config apollon_lcd_config __initdata = { ...@@ -182,6 +250,7 @@ static struct omap_lcd_config apollon_lcd_config __initdata = {
static struct omap_board_config_kernel apollon_config[] = { static struct omap_board_config_kernel apollon_config[] = {
{ OMAP_TAG_UART, &apollon_uart_config }, { OMAP_TAG_UART, &apollon_uart_config },
{ OMAP_TAG_MMC, &apollon_mmc_config }, { OMAP_TAG_MMC, &apollon_mmc_config },
{ OMAP_TAG_USB, &apollon_usb_config },
{ OMAP_TAG_LCD, &apollon_lcd_config }, { OMAP_TAG_LCD, &apollon_lcd_config },
}; };
...@@ -250,10 +319,22 @@ static void __init apollon_sw_init(void) ...@@ -250,10 +319,22 @@ static void __init apollon_sw_init(void)
return; return;
} }
static void __init apollon_usb_init(void)
{
/* USB device */
/* DEVICE_SUSPEND */
omap_cfg_reg(P21_242X_GPIO12);
omap_request_gpio(12);
omap_set_gpio_direction(12, 0); /* OUT */
omap_set_gpio_dataout(12, 0);
}
static void __init omap_apollon_init(void) static void __init omap_apollon_init(void)
{ {
apollon_led_init(); apollon_led_init();
apollon_sw_init(); apollon_sw_init();
apollon_flash_init();
apollon_usb_init();
/* REVISIT: where's the correct place */ /* REVISIT: where's the correct place */
omap_cfg_reg(W19_24XX_SYS_NIRQ); omap_cfg_reg(W19_24XX_SYS_NIRQ);
......
...@@ -131,26 +131,6 @@ static struct platform_device h4_flash_device = { ...@@ -131,26 +131,6 @@ static struct platform_device h4_flash_device = {
.resource = &h4_flash_resource, .resource = &h4_flash_resource,
}; };
static struct resource h4_smc91x_resources[] = {
[0] = {
.start = OMAP24XX_ETHR_START, /* Physical */
.end = OMAP24XX_ETHR_START + 0xf,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
.end = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device h4_smc91x_device = {
.name = "smc91x",
.id = -1,
.num_resources = ARRAY_SIZE(h4_smc91x_resources),
.resource = h4_smc91x_resources,
};
/* Select between the IrDA and aGPS module /* Select between the IrDA and aGPS module
*/ */
static int h4_select_irda(struct device *dev, int state) static int h4_select_irda(struct device *dev, int state)
...@@ -266,29 +246,14 @@ static struct platform_device h4_lcd_device = { ...@@ -266,29 +246,14 @@ static struct platform_device h4_lcd_device = {
.id = -1, .id = -1,
}; };
static struct resource h4_led_resources[] = {
[0] = {
.flags = IORESOURCE_MEM,
},
};
static struct platform_device h4_led_device = {
.name = "omap_dbg_led",
.id = -1,
.num_resources = ARRAY_SIZE(h4_led_resources),
.resource = h4_led_resources,
};
static struct platform_device *h4_devices[] __initdata = { static struct platform_device *h4_devices[] __initdata = {
&h4_smc91x_device,
&h4_flash_device, &h4_flash_device,
&h4_irda_device, &h4_irda_device,
&h4_kp_device, &h4_kp_device,
&h4_lcd_device, &h4_lcd_device,
&h4_led_device,
}; };
static inline void __init h4_init_smc91x(void) static inline void __init h4_init_debug(void)
{ {
/* Make sure CS1 timings are correct */ /* Make sure CS1 timings are correct */
GPMC_CONFIG1_1 = 0x00011200; GPMC_CONFIG1_1 = 0x00011200;
...@@ -301,12 +266,8 @@ static inline void __init h4_init_smc91x(void) ...@@ -301,12 +266,8 @@ static inline void __init h4_init_smc91x(void)
udelay(100); udelay(100);
omap_cfg_reg(M15_24XX_GPIO92); omap_cfg_reg(M15_24XX_GPIO92);
if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ) < 0) { if (debug_card_init(cs_mem_base, OMAP24XX_ETHR_GPIO_IRQ) < 0)
printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", gpmc_cs_free(eth_cs);
OMAP24XX_ETHR_GPIO_IRQ);
return;
}
omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1);
} }
static void __init omap_h4_init_irq(void) static void __init omap_h4_init_irq(void)
...@@ -314,7 +275,6 @@ static void __init omap_h4_init_irq(void) ...@@ -314,7 +275,6 @@ static void __init omap_h4_init_irq(void)
omap2_init_common_hw(); omap2_init_common_hw();
omap_init_irq(); omap_init_irq();
omap_gpio_init(); omap_gpio_init();
h4_init_smc91x();
} }
static struct omap_uart_config h4_uart_config __initdata = { static struct omap_uart_config h4_uart_config __initdata = {
......
...@@ -55,8 +55,10 @@ static void omap_init_i2c(void) ...@@ -55,8 +55,10 @@ static void omap_init_i2c(void)
if (machine_is_omap_h4()) if (machine_is_omap_h4())
return; return;
if (!cpu_is_omap2430()) {
omap_cfg_reg(J15_24XX_I2C2_SCL); omap_cfg_reg(J15_24XX_I2C2_SCL);
omap_cfg_reg(H19_24XX_I2C2_SDA); omap_cfg_reg(H19_24XX_I2C2_SDA);
}
(void) platform_device_register(&omap_i2c_device2); (void) platform_device_register(&omap_i2c_device2);
} }
......
...@@ -22,7 +22,14 @@ ...@@ -22,7 +22,14 @@
#undef DEBUG #undef DEBUG
#ifdef CONFIG_ARCH_OMAP2420
#define GPMC_BASE 0x6800a000 #define GPMC_BASE 0x6800a000
#endif
#ifdef CONFIG_ARCH_OMAP2430
#define GPMC_BASE 0x6E000000
#endif
#define GPMC_REVISION 0x00 #define GPMC_REVISION 0x00
#define GPMC_SYSCONFIG 0x10 #define GPMC_SYSCONFIG 0x10
#define GPMC_SYSSTATUS 0x14 #define GPMC_SYSSTATUS 0x14
...@@ -88,7 +95,7 @@ u32 gpmc_cs_read_reg(int cs, int idx) ...@@ -88,7 +95,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
} }
/* TODO: Add support for gpmc_fck to clock framework and use it */ /* TODO: Add support for gpmc_fck to clock framework and use it */
static unsigned long gpmc_get_fclk_period(void) unsigned long gpmc_get_fclk_period(void)
{ {
/* In picoseconds */ /* In picoseconds */
return 1000000000 / ((clk_get_rate(gpmc_l3_clk)) / 1000); return 1000000000 / ((clk_get_rate(gpmc_l3_clk)) / 1000);
...@@ -104,6 +111,13 @@ unsigned int gpmc_ns_to_ticks(unsigned int time_ns) ...@@ -104,6 +111,13 @@ unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
return (time_ns * 1000 + tick_ps - 1) / tick_ps; return (time_ns * 1000 + tick_ps - 1) / tick_ps;
} }
unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns)
{
unsigned long ticks = gpmc_ns_to_ticks(time_ns);
return ticks * gpmc_get_fclk_period() / 1000;
}
#ifdef DEBUG #ifdef DEBUG
static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
int time, const char *name) int time, const char *name)
...@@ -120,15 +134,21 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, ...@@ -120,15 +134,21 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
else else
ticks = gpmc_ns_to_ticks(time); ticks = gpmc_ns_to_ticks(time);
nr_bits = end_bit - st_bit + 1; nr_bits = end_bit - st_bit + 1;
if (ticks >= 1 << nr_bits) if (ticks >= 1 << nr_bits) {
#ifdef DEBUG
printk(KERN_INFO "GPMC CS%d: %-10s* %3d ns, %3d ticks >= %d\n",
cs, name, time, ticks, 1 << nr_bits);
#endif
return -1; return -1;
}
mask = (1 << nr_bits) - 1; mask = (1 << nr_bits) - 1;
l = gpmc_cs_read_reg(cs, reg); l = gpmc_cs_read_reg(cs, reg);
#ifdef DEBUG #ifdef DEBUG
printk(KERN_INFO "GPMC CS%d: %-10s: %d ticks, %3lu ns (was %i ticks)\n", printk(KERN_INFO
"GPMC CS%d: %-10s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n",
cs, name, ticks, gpmc_get_fclk_period() * ticks / 1000, cs, name, ticks, gpmc_get_fclk_period() * ticks / 1000,
(l >> st_bit) & mask); (l >> st_bit) & mask, time);
#endif #endif
l &= ~(mask << st_bit); l &= ~(mask << st_bit);
l |= ticks << st_bit; l |= ticks << st_bit;
...@@ -157,7 +177,7 @@ int gpmc_cs_calc_divider(int cs, unsigned int sync_clk) ...@@ -157,7 +177,7 @@ int gpmc_cs_calc_divider(int cs, unsigned int sync_clk)
div = l / gpmc_get_fclk_period(); div = l / gpmc_get_fclk_period();
if (div > 4) if (div > 4)
return -1; return -1;
if (div < 0) if (div <= 0)
div = 1; div = 1;
return div; return div;
...@@ -191,14 +211,19 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t) ...@@ -191,14 +211,19 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access); GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access);
/* caller is expected to have initialized CONFIG1 to cover
* at least sync vs async
*/
l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
if (l & (GPMC_CONFIG1_READTYPE_SYNC | GPMC_CONFIG1_WRITETYPE_SYNC)) {
#ifdef DEBUG #ifdef DEBUG
printk(KERN_INFO "GPMC CS%d CLK period is %lu (div %d)\n", printk(KERN_INFO "GPMC CS%d CLK period is %lu ns (div %d)\n",
cs, gpmc_get_fclk_period(), div); cs, (div * gpmc_get_fclk_period()) / 1000, div);
#endif #endif
l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
l &= ~0x03; l &= ~0x03;
l |= (div - 1); l |= (div - 1);
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, l);
}
return 0; return 0;
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment