mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (262 commits) sh: mach-ecovec24: Add user debug switch support sh: Kill off unused se_skipped in alignment trap notification code. sh: Wire up HAVE_SYSCALL_TRACEPOINTS. video: sh_mobile_lcdcfb: use both register sets for display panning video: sh_mobile_lcdcfb: implement display panning sh: Fix up sh7705 flush_dcache_page() build. sh: kfr2r09: document the PLL/FLL <-> RF relationship. sh: mach-ecovec24: need asm/clock.h. sh: mach-ecovec24: deassert usb irq on boot. sh: Add KEYSC support for EcoVec24 sh: add kycr2_delay for sh_keysc sh: cpufreq: Include CPU id in info messages. sh: multi-evt support for SH-X3 proto CPU. sh: clkfwk: remove bogus set_bus_parent() from SH7709. sh: Fix the indication point of the liquid crystal of AP-325RXA(AP3300) sh: Add EcoVec24 romImage defconfig sh: USB disable process is needed if romImage boot for EcoVec24 sh: EcoVec24: add HIZA setting for LED sh: EcoVec24: write MAC address in boot sh: Add romImage support for EcoVec24 ...
This commit is contained in:
@@ -1565,7 +1565,7 @@ and is between 256 and 4096 characters. It is defined in the file
|
||||
of returning the full 64-bit number.
|
||||
The default is to return 64-bit inode numbers.
|
||||
|
||||
nmi_debug= [KNL,AVR32] Specify one or more actions to take
|
||||
nmi_debug= [KNL,AVR32,SH] Specify one or more actions to take
|
||||
when a NMI is triggered.
|
||||
Format: [state][,regs][,debounce][,die]
|
||||
|
||||
|
||||
+40
-4
@@ -10,12 +10,17 @@ config SUPERH
|
||||
select EMBEDDED
|
||||
select HAVE_CLK
|
||||
select HAVE_IDE
|
||||
select HAVE_LMB
|
||||
select HAVE_OPROFILE
|
||||
select HAVE_GENERIC_DMA_COHERENT
|
||||
select HAVE_IOREMAP_PROT if MMU
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_DMA_API_DEBUG
|
||||
select HAVE_PERF_COUNTERS
|
||||
select HAVE_KERNEL_GZIP
|
||||
select HAVE_KERNEL_BZIP2
|
||||
select HAVE_KERNEL_LZMA
|
||||
select HAVE_SYSCALL_TRACEPOINTS
|
||||
select RTC_LIB
|
||||
select GENERIC_ATOMIC64
|
||||
help
|
||||
@@ -31,6 +36,9 @@ config SUPERH32
|
||||
select HAVE_FUNCTION_TRACER
|
||||
select HAVE_FTRACE_MCOUNT_RECORD
|
||||
select HAVE_DYNAMIC_FTRACE
|
||||
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
|
||||
select HAVE_FTRACE_SYSCALLS
|
||||
select HAVE_FUNCTION_GRAPH_TRACER
|
||||
select HAVE_ARCH_KGDB
|
||||
select ARCH_HIBERNATION_POSSIBLE if MMU
|
||||
|
||||
@@ -212,6 +220,8 @@ config CPU_SHX3
|
||||
config ARCH_SHMOBILE
|
||||
bool
|
||||
select ARCH_SUSPEND_POSSIBLE
|
||||
select PM
|
||||
select PM_RUNTIME
|
||||
|
||||
if SUPERH32
|
||||
|
||||
@@ -389,6 +399,13 @@ config CPU_SUBTYPE_SH7724
|
||||
help
|
||||
Select SH7724 if you have an SH-MobileR2R CPU.
|
||||
|
||||
config CPU_SUBTYPE_SH7757
|
||||
bool "Support SH7757 processor"
|
||||
select CPU_SH4A
|
||||
select CPU_SHX2
|
||||
help
|
||||
Select SH7757 if you have a SH4A SH7757 CPU.
|
||||
|
||||
config CPU_SUBTYPE_SH7763
|
||||
bool "Support SH7763 processor"
|
||||
select CPU_SH4A
|
||||
@@ -751,12 +768,31 @@ config UBC_WAKEUP
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config CMDLINE_BOOL
|
||||
bool "Default bootloader kernel arguments"
|
||||
choice
|
||||
prompt "Kernel command line"
|
||||
optional
|
||||
default CMDLINE_OVERWRITE
|
||||
help
|
||||
Setting this option allows the kernel command line arguments
|
||||
to be set.
|
||||
|
||||
config CMDLINE_OVERWRITE
|
||||
bool "Overwrite bootloader kernel arguments"
|
||||
help
|
||||
Given string will overwrite any arguments passed in by
|
||||
a bootloader.
|
||||
|
||||
config CMDLINE_EXTEND
|
||||
bool "Extend bootloader kernel arguments"
|
||||
help
|
||||
Given string will be concatenated with arguments passed in
|
||||
by a bootloader.
|
||||
|
||||
endchoice
|
||||
|
||||
config CMDLINE
|
||||
string "Initial kernel command string"
|
||||
depends on CMDLINE_BOOL
|
||||
string "Kernel command line arguments string"
|
||||
depends on CMDLINE_OVERWRITE || CMDLINE_EXTEND
|
||||
default "console=ttySC1,115200"
|
||||
|
||||
endmenu
|
||||
|
||||
+20
-3
@@ -38,11 +38,13 @@ config EARLY_SCIF_CONSOLE_PORT
|
||||
default "0xffe00000" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7763 || \
|
||||
CPU_SUBTYPE_SH7722 || CPU_SUBTYPE_SH7366 || \
|
||||
CPU_SUBTYPE_SH7343
|
||||
default "0xffea0000" if CPU_SUBTYPE_SH7785
|
||||
default "0xfe4c0000" if CPU_SUBTYPE_SH7757
|
||||
default "0xffeb0000" if CPU_SUBTYPE_SH7785
|
||||
default "0xffeb0000" if CPU_SUBTYPE_SH7786
|
||||
default "0xfffe8000" if CPU_SUBTYPE_SH7203
|
||||
default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263
|
||||
default "0xffe80000" if CPU_SH4
|
||||
default "0xa4000150" if CPU_SH3
|
||||
default "0x00000000"
|
||||
|
||||
config EARLY_PRINTK
|
||||
@@ -61,12 +63,14 @@ config EARLY_PRINTK
|
||||
select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using
|
||||
the kernel command line option to toggle back and forth.
|
||||
|
||||
config DEBUG_STACKOVERFLOW
|
||||
config STACK_DEBUG
|
||||
bool "Check for stack overflows"
|
||||
depends on DEBUG_KERNEL && SUPERH32
|
||||
help
|
||||
This option will cause messages to be printed if free stack space
|
||||
drops below a certain limit.
|
||||
drops below a certain limit. Saying Y here will add overhead to
|
||||
every function call and will therefore incur a major
|
||||
performance hit. Most users should say N.
|
||||
|
||||
config DEBUG_STACK_USAGE
|
||||
bool "Stack utilization instrumentation"
|
||||
@@ -107,6 +111,14 @@ config DUMP_CODE
|
||||
|
||||
Those looking for more verbose debugging output should say Y.
|
||||
|
||||
config DWARF_UNWINDER
|
||||
bool "Enable the DWARF unwinder for stacktraces"
|
||||
select FRAME_POINTER
|
||||
default n
|
||||
help
|
||||
Enabling this option will make stacktraces more accurate, at
|
||||
the cost of an increase in overall kernel size.
|
||||
|
||||
config SH_NO_BSS_INIT
|
||||
bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)"
|
||||
depends on DEBUG_KERNEL
|
||||
@@ -123,4 +135,9 @@ config SH64_SR_WATCH
|
||||
bool "Debug: set SR.WATCH to enable hardware watchpoints and trace"
|
||||
depends on SUPERH64
|
||||
|
||||
config MCOUNT
|
||||
def_bool y
|
||||
depends on SUPERH32
|
||||
depends on STACK_DEBUG || FUNCTION_TRACER
|
||||
|
||||
endmenu
|
||||
|
||||
+21
-5
@@ -136,6 +136,8 @@ machdir-$(CONFIG_SH_7751_SYSTEMH) += mach-systemh
|
||||
machdir-$(CONFIG_SH_EDOSK7705) += mach-edosk7705
|
||||
machdir-$(CONFIG_SH_HIGHLANDER) += mach-highlander
|
||||
machdir-$(CONFIG_SH_MIGOR) += mach-migor
|
||||
machdir-$(CONFIG_SH_KFR2R09) += mach-kfr2r09
|
||||
machdir-$(CONFIG_SH_ECOVEC) += mach-ecovec24
|
||||
machdir-$(CONFIG_SH_SDK7780) += mach-sdk7780
|
||||
machdir-$(CONFIG_SH_X3PROTO) += mach-x3proto
|
||||
machdir-$(CONFIG_SH_SH7763RDP) += mach-sh7763rdp
|
||||
@@ -186,17 +188,27 @@ KBUILD_CFLAGS += -pipe $(cflags-y)
|
||||
KBUILD_CPPFLAGS += $(cflags-y)
|
||||
KBUILD_AFLAGS += $(cflags-y)
|
||||
|
||||
ifeq ($(CONFIG_MCOUNT),y)
|
||||
KBUILD_CFLAGS += -pg
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DWARF_UNWINDER),y)
|
||||
KBUILD_CFLAGS += -fasynchronous-unwind-tables
|
||||
endif
|
||||
|
||||
libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
|
||||
libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
|
||||
|
||||
PHONY += maketools FORCE
|
||||
BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.srec \
|
||||
zImage vmlinux.srec romImage
|
||||
PHONY += maketools $(BOOT_TARGETS) FORCE
|
||||
|
||||
maketools: include/linux/version.h FORCE
|
||||
$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
|
||||
|
||||
all: $(KBUILD_IMAGE)
|
||||
|
||||
zImage uImage uImage.srec vmlinux.srec: vmlinux
|
||||
$(BOOT_TARGETS): vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
|
||||
|
||||
compressed: zImage
|
||||
@@ -208,10 +220,14 @@ archclean:
|
||||
$(Q)$(MAKE) $(clean)=arch/sh/kernel/vsyscall
|
||||
|
||||
define archhelp
|
||||
@echo '* zImage - Compressed kernel image'
|
||||
@echo ' zImage - Compressed kernel image'
|
||||
@echo ' romImage - Compressed ROM image, if supported'
|
||||
@echo ' vmlinux.srec - Create an ELF S-record'
|
||||
@echo ' uImage - Create a bootable image for U-Boot'
|
||||
@echo ' uImage.srec - Create an S-record for U-Boot'
|
||||
@echo '* uImage - Alias to bootable U-Boot image'
|
||||
@echo ' uImage.srec - Create an S-record for U-Boot'
|
||||
@echo '* uImage.gz - Kernel-only image for U-Boot (gzip)'
|
||||
@echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)'
|
||||
@echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)'
|
||||
endef
|
||||
|
||||
CLEAN_FILES += include/asm-sh/machtypes.h
|
||||
|
||||
+21
-1
@@ -160,7 +160,6 @@ config SH_SH7785LCR
|
||||
bool "SH7785LCR"
|
||||
depends on CPU_SUBTYPE_SH7785
|
||||
select SYS_SUPPORTS_PCI
|
||||
select IO_TRAPPED if MMU
|
||||
|
||||
config SH_SH7785LCR_29BIT_PHYSMAPS
|
||||
bool "SH7785LCR 29bit physmaps"
|
||||
@@ -171,6 +170,13 @@ config SH_SH7785LCR_29BIT_PHYSMAPS
|
||||
DIP switch(S2-5). If you set the DIP switch for S2-5 = ON,
|
||||
you can access all on-board device in 29bit address mode.
|
||||
|
||||
config SH_SH7785LCR_PT
|
||||
bool "SH7785LCR prototype board on 32-bit MMU mode"
|
||||
depends on SH_SH7785LCR && 32BIT
|
||||
default n
|
||||
help
|
||||
If you use prototype board, this option is enabled.
|
||||
|
||||
config SH_URQUELL
|
||||
bool "Urquell"
|
||||
depends on CPU_SUBTYPE_SH7786
|
||||
@@ -193,6 +199,20 @@ config SH_AP325RXA
|
||||
Renesas "AP-325RXA" support.
|
||||
Compatible with ALGO SYSTEM CO.,LTD. "AP-320A"
|
||||
|
||||
config SH_KFR2R09
|
||||
bool "KFR2R09"
|
||||
depends on CPU_SUBTYPE_SH7724
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
help
|
||||
"Kit For R2R for 2009" support.
|
||||
|
||||
config SH_ECOVEC
|
||||
bool "EcoVec"
|
||||
depends on CPU_SUBTYPE_SH7724
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
help
|
||||
Renesas "R0P7724LC0011/21RL (EcoVec)" support.
|
||||
|
||||
config SH_SH7763RDP
|
||||
bool "SH7763RDP"
|
||||
depends on CPU_SUBTYPE_SH7763
|
||||
|
||||
@@ -188,7 +188,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
|
||||
.name = "LB070WV1",
|
||||
.xres = 800,
|
||||
.yres = 480,
|
||||
.left_margin = 40,
|
||||
.left_margin = 32,
|
||||
.right_margin = 160,
|
||||
.hsync_len = 8,
|
||||
.upper_margin = 63,
|
||||
@@ -211,7 +211,7 @@ static struct resource lcdc_resources[] = {
|
||||
[0] = {
|
||||
.name = "LCDC",
|
||||
.start = 0xfe940000, /* P4-only space */
|
||||
.end = 0xfe941fff,
|
||||
.end = 0xfe942fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
@@ -227,6 +227,9 @@ static struct platform_device lcdc_device = {
|
||||
.dev = {
|
||||
.platform_data = &lcdc_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_LCDC,
|
||||
},
|
||||
};
|
||||
|
||||
static void camera_power(int val)
|
||||
@@ -377,6 +380,9 @@ static struct platform_device ceu_device = {
|
||||
.dev = {
|
||||
.platform_data = &sh_mobile_ceu_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_CEU,
|
||||
},
|
||||
};
|
||||
|
||||
struct spi_gpio_platform_data sdcard_cn3_platform_data = {
|
||||
|
||||
@@ -223,6 +223,19 @@ static struct platform_device sm501_device = {
|
||||
.resource = sm501_resources,
|
||||
};
|
||||
|
||||
static struct resource i2c_proto_resources[] = {
|
||||
[0] = {
|
||||
.start = PCA9564_PROTO_32BIT_ADDR,
|
||||
.end = PCA9564_PROTO_32BIT_ADDR + PCA9564_SIZE - 1,
|
||||
.flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
|
||||
},
|
||||
[1] = {
|
||||
.start = 12,
|
||||
.end = 12,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource i2c_resources[] = {
|
||||
[0] = {
|
||||
.start = PCA9564_ADDR,
|
||||
@@ -271,6 +284,11 @@ static int __init sh7785lcr_devices_setup(void)
|
||||
i2c_register_board_info(0, sh7785lcr_i2c_devices,
|
||||
ARRAY_SIZE(sh7785lcr_i2c_devices));
|
||||
|
||||
if (mach_is_sh7785lcr_pt()) {
|
||||
i2c_device.resource = i2c_proto_resources;
|
||||
i2c_device.num_resources = ARRAY_SIZE(i2c_proto_resources);
|
||||
}
|
||||
|
||||
return platform_add_devices(sh7785lcr_devices,
|
||||
ARRAY_SIZE(sh7785lcr_devices));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Makefile for the R0P7724LC0011/21RL (EcoVec)
|
||||
#
|
||||
# This file is subject to the terms and conditions of the GNU General Public
|
||||
# License. See the file "COPYING" in the main directory of this archive
|
||||
# for more details.
|
||||
#
|
||||
|
||||
obj-y := setup.o
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,7 @@
|
||||
#include <linux/irq.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/usb/r8a66597.h>
|
||||
#include <linux/usb/m66592.h>
|
||||
#include <net/ax88796.h>
|
||||
#include <asm/machvec.h>
|
||||
#include <mach/highlander.h>
|
||||
@@ -60,6 +61,11 @@ static struct platform_device r8a66597_usb_host_device = {
|
||||
.resource = r8a66597_usb_host_resources,
|
||||
};
|
||||
|
||||
static struct m66592_platdata usbf_platdata = {
|
||||
.xtal = M66592_PLATDATA_XTAL_24MHZ,
|
||||
.vif = 1,
|
||||
};
|
||||
|
||||
static struct resource m66592_usb_peripheral_resources[] = {
|
||||
[0] = {
|
||||
.name = "m66592_udc",
|
||||
@@ -81,6 +87,7 @@ static struct platform_device m66592_usb_peripheral_device = {
|
||||
.dev = {
|
||||
.dma_mask = NULL, /* don't use dma */
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
.platform_data = &usbf_platdata,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(m66592_usb_peripheral_resources),
|
||||
.resource = m66592_usb_peripheral_resources,
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
obj-y := setup.o
|
||||
obj-$(CONFIG_FB_SH_MOBILE_LCDC) += lcd_wqvga.o
|
||||
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
* KFR2R09 LCD panel support
|
||||
*
|
||||
* Copyright (C) 2009 Magnus Damm
|
||||
*
|
||||
* Register settings based on the out-of-tree t33fb.c driver
|
||||
* Copyright (C) 2008 Lineo Solutions, Inc.
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file COPYING in the main directory of this archive for
|
||||
* more details.
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <video/sh_mobile_lcdc.h>
|
||||
#include <mach/kfr2r09.h>
|
||||
#include <cpu/sh7724.h>
|
||||
|
||||
/* The on-board LCD module is a Hitachi TX07D34VM0AAA. This module is made
|
||||
* up of a 240x400 LCD hooked up to a R61517 driver IC. The driver IC is
|
||||
* communicating with the main port of the LCDC using an 18-bit SYS interface.
|
||||
*
|
||||
* The device code for this LCD module is 0x01221517.
|
||||
*/
|
||||
|
||||
static const unsigned char data_frame_if[] = {
|
||||
0x02, /* WEMODE: 1=cont, 0=one-shot */
|
||||
0x00, 0x00,
|
||||
0x00, /* EPF, DFM */
|
||||
0x02, /* RIM[1] : 1 (18bpp) */
|
||||
};
|
||||
|
||||
static const unsigned char data_panel[] = {
|
||||
0x0b,
|
||||
0x63, /* 400 lines */
|
||||
0x04, 0x00, 0x00, 0x04, 0x11, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static const unsigned char data_timing[] = {
|
||||
0x00, 0x00, 0x13, 0x08, 0x08,
|
||||
};
|
||||
|
||||
static const unsigned char data_timing_src[] = {
|
||||
0x11, 0x01, 0x00, 0x01,
|
||||
};
|
||||
|
||||
static const unsigned char data_gamma[] = {
|
||||
0x01, 0x02, 0x08, 0x23, 0x03, 0x0c, 0x00, 0x06, 0x00, 0x00,
|
||||
0x01, 0x00, 0x0c, 0x23, 0x03, 0x08, 0x02, 0x06, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static const unsigned char data_power[] = {
|
||||
0x07, 0xc5, 0xdc, 0x02, 0x33, 0x0a,
|
||||
};
|
||||
|
||||
static unsigned long read_reg(void *sohandle,
|
||||
struct sh_mobile_lcdc_sys_bus_ops *so)
|
||||
{
|
||||
return so->read_data(sohandle);
|
||||
}
|
||||
|
||||
static void write_reg(void *sohandle,
|
||||
struct sh_mobile_lcdc_sys_bus_ops *so,
|
||||
int i, unsigned long v)
|
||||
{
|
||||
if (i)
|
||||
so->write_data(sohandle, v); /* PTH4/LCDRS High [param, 17:0] */
|
||||
else
|
||||
so->write_index(sohandle, v); /* PTH4/LCDRS Low [cmd, 7:0] */
|
||||
}
|
||||
|
||||
static void write_data(void *sohandle,
|
||||
struct sh_mobile_lcdc_sys_bus_ops *so,
|
||||
unsigned char const *data, int no_data)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < no_data; i++)
|
||||
write_reg(sohandle, so, 1, data[i]);
|
||||
}
|
||||
|
||||
static unsigned long read_device_code(void *sohandle,
|
||||
struct sh_mobile_lcdc_sys_bus_ops *so)
|
||||
{
|
||||
unsigned long device_code;
|
||||
|
||||
/* access protect OFF */
|
||||
write_reg(sohandle, so, 0, 0xb0);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
|
||||
/* deep standby OFF */
|
||||
write_reg(sohandle, so, 0, 0xb1);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
|
||||
/* device code command */
|
||||
write_reg(sohandle, so, 0, 0xbf);
|
||||
mdelay(50);
|
||||
|
||||
/* dummy read */
|
||||
read_reg(sohandle, so);
|
||||
|
||||
/* read device code */
|
||||
device_code = ((read_reg(sohandle, so) & 0xff) << 24);
|
||||
device_code |= ((read_reg(sohandle, so) & 0xff) << 16);
|
||||
device_code |= ((read_reg(sohandle, so) & 0xff) << 8);
|
||||
device_code |= (read_reg(sohandle, so) & 0xff);
|
||||
|
||||
return device_code;
|
||||
}
|
||||
|
||||
static void write_memory_start(void *sohandle,
|
||||
struct sh_mobile_lcdc_sys_bus_ops *so)
|
||||
{
|
||||
write_reg(sohandle, so, 0, 0x2c);
|
||||
}
|
||||
|
||||
static void clear_memory(void *sohandle,
|
||||
struct sh_mobile_lcdc_sys_bus_ops *so)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* write start */
|
||||
write_memory_start(sohandle, so);
|
||||
|
||||
/* paint it black */
|
||||
for (i = 0; i < (240 * 400); i++)
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
}
|
||||
|
||||
static void display_on(void *sohandle,
|
||||
struct sh_mobile_lcdc_sys_bus_ops *so)
|
||||
{
|
||||
/* access protect off */
|
||||
write_reg(sohandle, so, 0, 0xb0);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
|
||||
/* exit deep standby mode */
|
||||
write_reg(sohandle, so, 0, 0xb1);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
|
||||
/* frame memory I/F */
|
||||
write_reg(sohandle, so, 0, 0xb3);
|
||||
write_data(sohandle, so, data_frame_if, ARRAY_SIZE(data_frame_if));
|
||||
|
||||
/* display mode and frame memory write mode */
|
||||
write_reg(sohandle, so, 0, 0xb4);
|
||||
write_reg(sohandle, so, 1, 0x00); /* DBI, internal clock */
|
||||
|
||||
/* panel */
|
||||
write_reg(sohandle, so, 0, 0xc0);
|
||||
write_data(sohandle, so, data_panel, ARRAY_SIZE(data_panel));
|
||||
|
||||
/* timing (normal) */
|
||||
write_reg(sohandle, so, 0, 0xc1);
|
||||
write_data(sohandle, so, data_timing, ARRAY_SIZE(data_timing));
|
||||
|
||||
/* timing (partial) */
|
||||
write_reg(sohandle, so, 0, 0xc2);
|
||||
write_data(sohandle, so, data_timing, ARRAY_SIZE(data_timing));
|
||||
|
||||
/* timing (idle) */
|
||||
write_reg(sohandle, so, 0, 0xc3);
|
||||
write_data(sohandle, so, data_timing, ARRAY_SIZE(data_timing));
|
||||
|
||||
/* timing (source/VCOM/gate driving) */
|
||||
write_reg(sohandle, so, 0, 0xc4);
|
||||
write_data(sohandle, so, data_timing_src, ARRAY_SIZE(data_timing_src));
|
||||
|
||||
/* gamma (red) */
|
||||
write_reg(sohandle, so, 0, 0xc8);
|
||||
write_data(sohandle, so, data_gamma, ARRAY_SIZE(data_gamma));
|
||||
|
||||
/* gamma (green) */
|
||||
write_reg(sohandle, so, 0, 0xc9);
|
||||
write_data(sohandle, so, data_gamma, ARRAY_SIZE(data_gamma));
|
||||
|
||||
/* gamma (blue) */
|
||||
write_reg(sohandle, so, 0, 0xca);
|
||||
write_data(sohandle, so, data_gamma, ARRAY_SIZE(data_gamma));
|
||||
|
||||
/* power (common) */
|
||||
write_reg(sohandle, so, 0, 0xd0);
|
||||
write_data(sohandle, so, data_power, ARRAY_SIZE(data_power));
|
||||
|
||||
/* VCOM */
|
||||
write_reg(sohandle, so, 0, 0xd1);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
write_reg(sohandle, so, 1, 0x0f);
|
||||
write_reg(sohandle, so, 1, 0x02);
|
||||
|
||||
/* power (normal) */
|
||||
write_reg(sohandle, so, 0, 0xd2);
|
||||
write_reg(sohandle, so, 1, 0x63);
|
||||
write_reg(sohandle, so, 1, 0x24);
|
||||
|
||||
/* power (partial) */
|
||||
write_reg(sohandle, so, 0, 0xd3);
|
||||
write_reg(sohandle, so, 1, 0x63);
|
||||
write_reg(sohandle, so, 1, 0x24);
|
||||
|
||||
/* power (idle) */
|
||||
write_reg(sohandle, so, 0, 0xd4);
|
||||
write_reg(sohandle, so, 1, 0x63);
|
||||
write_reg(sohandle, so, 1, 0x24);
|
||||
|
||||
write_reg(sohandle, so, 0, 0xd8);
|
||||
write_reg(sohandle, so, 1, 0x77);
|
||||
write_reg(sohandle, so, 1, 0x77);
|
||||
|
||||
/* TE signal */
|
||||
write_reg(sohandle, so, 0, 0x35);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
|
||||
/* TE signal line */
|
||||
write_reg(sohandle, so, 0, 0x44);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
|
||||
/* column address */
|
||||
write_reg(sohandle, so, 0, 0x2a);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
write_reg(sohandle, so, 1, 0xef);
|
||||
|
||||
/* page address */
|
||||
write_reg(sohandle, so, 0, 0x2b);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
write_reg(sohandle, so, 1, 0x00);
|
||||
write_reg(sohandle, so, 1, 0x01);
|
||||
write_reg(sohandle, so, 1, 0x8f);
|
||||
|
||||
/* exit sleep mode */
|
||||
write_reg(sohandle, so, 0, 0x11);
|
||||
|
||||
mdelay(120);
|
||||
|
||||
/* clear vram */
|
||||
clear_memory(sohandle, so);
|
||||
|
||||
/* display ON */
|
||||
write_reg(sohandle, so, 0, 0x29);
|
||||
mdelay(1);
|
||||
|
||||
write_memory_start(sohandle, so);
|
||||
}
|
||||
|
||||
int kfr2r09_lcd_setup(void *board_data, void *sohandle,
|
||||
struct sh_mobile_lcdc_sys_bus_ops *so)
|
||||
{
|
||||
/* power on */
|
||||
gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */
|
||||
gpio_set_value(GPIO_PTE4, 0); /* LCD_RST/ -> L */
|
||||
gpio_set_value(GPIO_PTF4, 1); /* PROTECT/ -> H */
|
||||
udelay(1100);
|
||||
gpio_set_value(GPIO_PTE4, 1); /* LCD_RST/ -> H */
|
||||
udelay(10);
|
||||
gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */
|
||||
mdelay(20);
|
||||
|
||||
if (read_device_code(sohandle, so) != 0x01221517)
|
||||
return -ENODEV;
|
||||
|
||||
pr_info("KFR2R09 WQVGA LCD Module detected.\n");
|
||||
|
||||
display_on(sohandle, so);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define CTRL_CKSW 0x10
|
||||
#define CTRL_C10 0x20
|
||||
#define CTRL_CPSW 0x80
|
||||
#define MAIN_MLED4 0x40
|
||||
#define MAIN_MSW 0x80
|
||||
|
||||
static int kfr2r09_lcd_backlight(int on)
|
||||
{
|
||||
struct i2c_adapter *a;
|
||||
struct i2c_msg msg;
|
||||
unsigned char buf[2];
|
||||
int ret;
|
||||
|
||||
a = i2c_get_adapter(0);
|
||||
if (!a)
|
||||
return -ENODEV;
|
||||
|
||||
buf[0] = 0x00;
|
||||
if (on)
|
||||
buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW;
|
||||
else
|
||||
buf[1] = 0;
|
||||
|
||||
msg.addr = 0x75;
|
||||
msg.buf = buf;
|
||||
msg.len = 2;
|
||||
msg.flags = 0;
|
||||
ret = i2c_transfer(a, &msg, 1);
|
||||
if (ret != 1)
|
||||
return -ENODEV;
|
||||
|
||||
buf[0] = 0x01;
|
||||
if (on)
|
||||
buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c;
|
||||
else
|
||||
buf[1] = 0;
|
||||
|
||||
msg.addr = 0x75;
|
||||
msg.buf = buf;
|
||||
msg.len = 2;
|
||||
msg.flags = 0;
|
||||
ret = i2c_transfer(a, &msg, 1);
|
||||
if (ret != 1)
|
||||
return -ENODEV;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void kfr2r09_lcd_on(void *board_data)
|
||||
{
|
||||
kfr2r09_lcd_backlight(1);
|
||||
}
|
||||
|
||||
void kfr2r09_lcd_off(void *board_data)
|
||||
{
|
||||
kfr2r09_lcd_backlight(0);
|
||||
}
|
||||
@@ -0,0 +1,386 @@
|
||||
/*
|
||||
* KFR2R09 board support code
|
||||
*
|
||||
* Copyright (C) 2009 Magnus Damm
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*/
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/mtd/onenand.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/usb/r8a66597.h>
|
||||
#include <video/sh_mobile_lcdc.h>
|
||||
#include <asm/clock.h>
|
||||
#include <asm/machvec.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/sh_keysc.h>
|
||||
#include <cpu/sh7724.h>
|
||||
#include <mach/kfr2r09.h>
|
||||
|
||||
static struct mtd_partition kfr2r09_nor_flash_partitions[] =
|
||||
{
|
||||
{
|
||||
.name = "boot",
|
||||
.offset = 0,
|
||||
.size = (4 * 1024 * 1024),
|
||||
.mask_flags = MTD_WRITEABLE, /* Read-only */
|
||||
},
|
||||
{
|
||||
.name = "other",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct physmap_flash_data kfr2r09_nor_flash_data = {
|
||||
.width = 2,
|
||||
.parts = kfr2r09_nor_flash_partitions,
|
||||
.nr_parts = ARRAY_SIZE(kfr2r09_nor_flash_partitions),
|
||||
};
|
||||
|
||||
static struct resource kfr2r09_nor_flash_resources[] = {
|
||||
[0] = {
|
||||
.name = "NOR Flash",
|
||||
.start = 0x00000000,
|
||||
.end = 0x03ffffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device kfr2r09_nor_flash_device = {
|
||||
.name = "physmap-flash",
|
||||
.resource = kfr2r09_nor_flash_resources,
|
||||
.num_resources = ARRAY_SIZE(kfr2r09_nor_flash_resources),
|
||||
.dev = {
|
||||
.platform_data = &kfr2r09_nor_flash_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource kfr2r09_nand_flash_resources[] = {
|
||||
[0] = {
|
||||
.name = "NAND Flash",
|
||||
.start = 0x10000000,
|
||||
.end = 0x1001ffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device kfr2r09_nand_flash_device = {
|
||||
.name = "onenand-flash",
|
||||
.resource = kfr2r09_nand_flash_resources,
|
||||
.num_resources = ARRAY_SIZE(kfr2r09_nand_flash_resources),
|
||||
};
|
||||
|
||||
static struct sh_keysc_info kfr2r09_sh_keysc_info = {
|
||||
.mode = SH_KEYSC_MODE_1, /* KEYOUT0->4, KEYIN0->4 */
|
||||
.scan_timing = 3,
|
||||
.delay = 10,
|
||||
.keycodes = {
|
||||
KEY_PHONE, KEY_CLEAR, KEY_MAIL, KEY_WWW, KEY_ENTER,
|
||||
KEY_1, KEY_2, KEY_3, 0, KEY_UP,
|
||||
KEY_4, KEY_5, KEY_6, 0, KEY_LEFT,
|
||||
KEY_7, KEY_8, KEY_9, KEY_PROG1, KEY_RIGHT,
|
||||
KEY_S, KEY_0, KEY_P, KEY_PROG2, KEY_DOWN,
|
||||
0, 0, 0, 0, 0
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource kfr2r09_sh_keysc_resources[] = {
|
||||
[0] = {
|
||||
.name = "KEYSC",
|
||||
.start = 0x044b0000,
|
||||
.end = 0x044b000f,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = 79,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device kfr2r09_sh_keysc_device = {
|
||||
.name = "sh_keysc",
|
||||
.id = 0, /* "keysc0" clock */
|
||||
.num_resources = ARRAY_SIZE(kfr2r09_sh_keysc_resources),
|
||||
.resource = kfr2r09_sh_keysc_resources,
|
||||
.dev = {
|
||||
.platform_data = &kfr2r09_sh_keysc_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_KEYSC,
|
||||
},
|
||||
};
|
||||
|
||||
static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
|
||||
.clock_source = LCDC_CLK_BUS,
|
||||
.ch[0] = {
|
||||
.chan = LCDC_CHAN_MAINLCD,
|
||||
.bpp = 16,
|
||||
.interface_type = SYS18,
|
||||
.clock_divider = 6,
|
||||
.flags = LCDC_FLAGS_DWPOL,
|
||||
.lcd_cfg = {
|
||||
.name = "TX07D34VM0AAA",
|
||||
.xres = 240,
|
||||
.yres = 400,
|
||||
.left_margin = 0,
|
||||
.right_margin = 16,
|
||||
.hsync_len = 8,
|
||||
.upper_margin = 0,
|
||||
.lower_margin = 1,
|
||||
.vsync_len = 1,
|
||||
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
|
||||
},
|
||||
.lcd_size_cfg = {
|
||||
.width = 35,
|
||||
.height = 58,
|
||||
},
|
||||
.board_cfg = {
|
||||
.setup_sys = kfr2r09_lcd_setup,
|
||||
.display_on = kfr2r09_lcd_on,
|
||||
.display_off = kfr2r09_lcd_off,
|
||||
},
|
||||
.sys_bus_cfg = {
|
||||
.ldmt2r = 0x07010904,
|
||||
.ldmt3r = 0x14012914,
|
||||
/* set 1s delay to encourage fsync() */
|
||||
.deferred_io_msec = 1000,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
static struct resource kfr2r09_sh_lcdc_resources[] = {
|
||||
[0] = {
|
||||
.name = "LCDC",
|
||||
.start = 0xfe940000, /* P4-only space */
|
||||
.end = 0xfe942fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = 106,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device kfr2r09_sh_lcdc_device = {
|
||||
.name = "sh_mobile_lcdc_fb",
|
||||
.num_resources = ARRAY_SIZE(kfr2r09_sh_lcdc_resources),
|
||||
.resource = kfr2r09_sh_lcdc_resources,
|
||||
.dev = {
|
||||
.platform_data = &kfr2r09_sh_lcdc_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_LCDC,
|
||||
},
|
||||
};
|
||||
|
||||
static struct r8a66597_platdata kfr2r09_usb0_gadget_data = {
|
||||
.on_chip = 1,
|
||||
};
|
||||
|
||||
static struct resource kfr2r09_usb0_gadget_resources[] = {
|
||||
[0] = {
|
||||
.start = 0x04d80000,
|
||||
.end = 0x04d80123,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = 65,
|
||||
.end = 65,
|
||||
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device kfr2r09_usb0_gadget_device = {
|
||||
.name = "r8a66597_udc",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = NULL, /* not use dma */
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
.platform_data = &kfr2r09_usb0_gadget_data,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(kfr2r09_usb0_gadget_resources),
|
||||
.resource = kfr2r09_usb0_gadget_resources,
|
||||
};
|
||||
|
||||
static struct platform_device *kfr2r09_devices[] __initdata = {
|
||||
&kfr2r09_nor_flash_device,
|
||||
&kfr2r09_nand_flash_device,
|
||||
&kfr2r09_sh_keysc_device,
|
||||
&kfr2r09_sh_lcdc_device,
|
||||
};
|
||||
|
||||
#define BSC_CS0BCR 0xfec10004
|
||||
#define BSC_CS0WCR 0xfec10024
|
||||
#define BSC_CS4BCR 0xfec10010
|
||||
#define BSC_CS4WCR 0xfec10030
|
||||
#define PORT_MSELCRB 0xa4050182
|
||||
|
||||
#ifdef CONFIG_I2C
|
||||
static int kfr2r09_usb0_gadget_i2c_setup(void)
|
||||
{
|
||||
struct i2c_adapter *a;
|
||||
struct i2c_msg msg;
|
||||
unsigned char buf[2];
|
||||
int ret;
|
||||
|
||||
a = i2c_get_adapter(0);
|
||||
if (!a)
|
||||
return -ENODEV;
|
||||
|
||||
/* set bit 1 (the second bit) of chip at 0x09, register 0x13 */
|
||||
buf[0] = 0x13;
|
||||
msg.addr = 0x09;
|
||||
msg.buf = buf;
|
||||
msg.len = 1;
|
||||
msg.flags = 0;
|
||||
ret = i2c_transfer(a, &msg, 1);
|
||||
if (ret != 1)
|
||||
return -ENODEV;
|
||||
|
||||
buf[0] = 0;
|
||||
msg.addr = 0x09;
|
||||
msg.buf = buf;
|
||||
msg.len = 1;
|
||||
msg.flags = I2C_M_RD;
|
||||
ret = i2c_transfer(a, &msg, 1);
|
||||
if (ret != 1)
|
||||
return -ENODEV;
|
||||
|
||||
buf[1] = buf[0] | (1 << 1);
|
||||
buf[0] = 0x13;
|
||||
msg.addr = 0x09;
|
||||
msg.buf = buf;
|
||||
msg.len = 2;
|
||||
msg.flags = 0;
|
||||
ret = i2c_transfer(a, &msg, 1);
|
||||
if (ret != 1)
|
||||
return -ENODEV;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int kfr2r09_usb0_gadget_i2c_setup(void)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int kfr2r09_usb0_gadget_setup(void)
|
||||
{
|
||||
int plugged_in;
|
||||
|
||||
gpio_request(GPIO_PTN4, NULL); /* USB_DET */
|
||||
gpio_direction_input(GPIO_PTN4);
|
||||
plugged_in = gpio_get_value(GPIO_PTN4);
|
||||
if (!plugged_in)
|
||||
return -ENODEV; /* no cable plugged in */
|
||||
|
||||
if (kfr2r09_usb0_gadget_i2c_setup() != 0)
|
||||
return -ENODEV; /* unable to configure using i2c */
|
||||
|
||||
ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
|
||||
gpio_request(GPIO_FN_PDSTATUS, NULL); /* R-standby disables USB clock */
|
||||
gpio_request(GPIO_PTV6, NULL); /* USBCLK_ON */
|
||||
gpio_direction_output(GPIO_PTV6, 1); /* USBCLK_ON = H */
|
||||
msleep(20); /* wait 20ms to let the clock settle */
|
||||
clk_enable(clk_get(NULL, "usb0"));
|
||||
ctrl_outw(0x0600, 0xa40501d4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init kfr2r09_devices_setup(void)
|
||||
{
|
||||
/* enable SCIF1 serial port for YC401 console support */
|
||||
gpio_request(GPIO_FN_SCIF1_RXD, NULL);
|
||||
gpio_request(GPIO_FN_SCIF1_TXD, NULL);
|
||||
|
||||
/* setup NOR flash at CS0 */
|
||||
ctrl_outl(0x36db0400, BSC_CS0BCR);
|
||||
ctrl_outl(0x00000500, BSC_CS0WCR);
|
||||
|
||||
/* setup NAND flash at CS4 */
|
||||
ctrl_outl(0x36db0400, BSC_CS4BCR);
|
||||
ctrl_outl(0x00000500, BSC_CS4WCR);
|
||||
|
||||
/* setup KEYSC pins */
|
||||
gpio_request(GPIO_FN_KEYOUT0, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT1, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT2, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT3, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN0, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN1, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN2, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN3, NULL);
|
||||
gpio_request(GPIO_FN_KEYIN4, NULL);
|
||||
gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
|
||||
|
||||
/* setup LCDC pins for SYS panel */
|
||||
gpio_request(GPIO_FN_LCDD17, NULL);
|
||||
gpio_request(GPIO_FN_LCDD16, NULL);
|
||||
gpio_request(GPIO_FN_LCDD15, NULL);
|
||||
gpio_request(GPIO_FN_LCDD14, NULL);
|
||||
gpio_request(GPIO_FN_LCDD13, NULL);
|
||||
gpio_request(GPIO_FN_LCDD12, NULL);
|
||||
gpio_request(GPIO_FN_LCDD11, NULL);
|
||||
gpio_request(GPIO_FN_LCDD10, NULL);
|
||||
gpio_request(GPIO_FN_LCDD9, NULL);
|
||||
gpio_request(GPIO_FN_LCDD8, NULL);
|
||||
gpio_request(GPIO_FN_LCDD7, NULL);
|
||||
gpio_request(GPIO_FN_LCDD6, NULL);
|
||||
gpio_request(GPIO_FN_LCDD5, NULL);
|
||||
gpio_request(GPIO_FN_LCDD4, NULL);
|
||||
gpio_request(GPIO_FN_LCDD3, NULL);
|
||||
gpio_request(GPIO_FN_LCDD2, NULL);
|
||||
gpio_request(GPIO_FN_LCDD1, NULL);
|
||||
gpio_request(GPIO_FN_LCDD0, NULL);
|
||||
gpio_request(GPIO_FN_LCDRS, NULL); /* LCD_RS */
|
||||
gpio_request(GPIO_FN_LCDCS, NULL); /* LCD_CS/ */
|
||||
gpio_request(GPIO_FN_LCDRD, NULL); /* LCD_RD/ */
|
||||
gpio_request(GPIO_FN_LCDWR, NULL); /* LCD_WR/ */
|
||||
gpio_request(GPIO_FN_LCDVSYN, NULL); /* LCD_VSYNC */
|
||||
gpio_request(GPIO_PTE4, NULL); /* LCD_RST/ */
|
||||
gpio_direction_output(GPIO_PTE4, 1);
|
||||
gpio_request(GPIO_PTF4, NULL); /* PROTECT/ */
|
||||
gpio_direction_output(GPIO_PTF4, 1);
|
||||
gpio_request(GPIO_PTU0, NULL); /* LEDSTDBY/ */
|
||||
gpio_direction_output(GPIO_PTU0, 1);
|
||||
|
||||
/* setup USB function */
|
||||
if (kfr2r09_usb0_gadget_setup() == 0)
|
||||
platform_device_register(&kfr2r09_usb0_gadget_device);
|
||||
|
||||
return platform_add_devices(kfr2r09_devices,
|
||||
ARRAY_SIZE(kfr2r09_devices));
|
||||
}
|
||||
device_initcall(kfr2r09_devices_setup);
|
||||
|
||||
/* Return the board specific boot mode pin configuration */
|
||||
static int kfr2r09_mode_pins(void)
|
||||
{
|
||||
/* MD0=1, MD1=1, MD2=0: Clock Mode 3
|
||||
* MD3=0: 16-bit Area0 Bus Width
|
||||
* MD5=1: Little Endian
|
||||
* MD8=1: Test Mode Disabled
|
||||
*/
|
||||
return MODE_PIN0 | MODE_PIN1 | MODE_PIN5 | MODE_PIN8;
|
||||
}
|
||||
|
||||
/*
|
||||
* The Machine Vector
|
||||
*/
|
||||
static struct sh_machine_vector mv_kfr2r09 __initmv = {
|
||||
.mv_name = "kfr2r09",
|
||||
.mv_mode_pins = kfr2r09_mode_pins,
|
||||
};
|
||||
@@ -98,6 +98,9 @@ static struct platform_device sh_keysc_device = {
|
||||
.dev = {
|
||||
.platform_data = &sh_keysc_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_KEYSC,
|
||||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition migor_nor_flash_partitions[] =
|
||||
@@ -276,7 +279,7 @@ static struct resource migor_lcdc_resources[] = {
|
||||
[0] = {
|
||||
.name = "LCDC",
|
||||
.start = 0xfe940000, /* P4-only space */
|
||||
.end = 0xfe941fff,
|
||||
.end = 0xfe942fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
@@ -292,6 +295,9 @@ static struct platform_device migor_lcdc_device = {
|
||||
.dev = {
|
||||
.platform_data = &sh_mobile_lcdc_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_LCDC,
|
||||
},
|
||||
};
|
||||
|
||||
static struct clk *camera_clk;
|
||||
@@ -379,6 +385,9 @@ static struct platform_device migor_ceu_device = {
|
||||
.dev = {
|
||||
.platform_data = &sh_mobile_ceu_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_CEU,
|
||||
},
|
||||
};
|
||||
|
||||
struct spi_gpio_platform_data sdcard_cn9_platform_data = {
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/heartbeat.h>
|
||||
#include <asm/sh_keysc.h>
|
||||
#include <cpu/sh7722.h>
|
||||
|
||||
/* Heartbeat */
|
||||
static struct heartbeat_data heartbeat_data = {
|
||||
@@ -137,6 +138,9 @@ static struct platform_device sh_keysc_device = {
|
||||
.dev = {
|
||||
.platform_data = &sh_keysc_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_KEYSC,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *se7722_devices[] __initdata = {
|
||||
|
||||
@@ -39,7 +39,15 @@
|
||||
* SW41 : abxx xxxx -> a = 0 : Analog monitor
|
||||
* 1 : Digital monitor
|
||||
* b = 0 : VGA
|
||||
* 1 : SVGA
|
||||
* 1 : 720p
|
||||
*/
|
||||
|
||||
/*
|
||||
* about 720p
|
||||
*
|
||||
* When you use 1280 x 720 lcdc output,
|
||||
* you should change OSC6 lcdc clock from 25.175MHz to 74.25MHz,
|
||||
* and change SW41 to use 720p
|
||||
*/
|
||||
|
||||
/* Heartbeat */
|
||||
@@ -158,7 +166,7 @@ static struct resource lcdc_resources[] = {
|
||||
[0] = {
|
||||
.name = "LCDC",
|
||||
.start = 0xfe940000,
|
||||
.end = 0xfe941fff,
|
||||
.end = 0xfe942fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
@@ -174,6 +182,9 @@ static struct platform_device lcdc_device = {
|
||||
.dev = {
|
||||
.platform_data = &lcdc_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_LCDC,
|
||||
},
|
||||
};
|
||||
|
||||
/* CEU0 */
|
||||
@@ -205,6 +216,9 @@ static struct platform_device ceu0_device = {
|
||||
.dev = {
|
||||
.platform_data = &sh_mobile_ceu0_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_CEU0,
|
||||
},
|
||||
};
|
||||
|
||||
/* CEU1 */
|
||||
@@ -236,6 +250,9 @@ static struct platform_device ceu1_device = {
|
||||
.dev = {
|
||||
.platform_data = &sh_mobile_ceu1_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_CEU1,
|
||||
},
|
||||
};
|
||||
|
||||
/* KEYSC in SoC (Needs SW33-2 set to ON) */
|
||||
@@ -274,6 +291,9 @@ static struct platform_device keysc_device = {
|
||||
.dev = {
|
||||
.platform_data = &keysc_info,
|
||||
},
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_KEYSC,
|
||||
},
|
||||
};
|
||||
|
||||
/* SH Eth */
|
||||
@@ -302,15 +322,19 @@ static struct platform_device sh_eth_device = {
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(sh_eth_resources),
|
||||
.resource = sh_eth_resources,
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_ETHER,
|
||||
},
|
||||
};
|
||||
|
||||
static struct r8a66597_platdata sh7724_usb0_host_data = {
|
||||
.on_chip = 1,
|
||||
};
|
||||
|
||||
static struct resource sh7724_usb0_host_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xa4d80000,
|
||||
.end = 0xa4d800ff,
|
||||
.end = 0xa4d80124 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
@@ -330,6 +354,38 @@ static struct platform_device sh7724_usb0_host_device = {
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(sh7724_usb0_host_resources),
|
||||
.resource = sh7724_usb0_host_resources,
|
||||
.archdata = {
|
||||
.hwblk_id = HWBLK_USB0,
|
||||
},
|
||||
};
|
||||
|
||||
static struct r8a66597_platdata sh7724_usb1_gadget_data = {
|
||||
.on_chip = 1,
|
||||
};
|
||||
|
||||
static struct resource sh7724_usb1_gadget_resources[] = {
|
||||
[0] = {
|
||||
.start = 0xa4d90000,
|
||||
.end = 0xa4d90123,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = 66,
|
||||
.end = 66,
|
||||
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device sh7724_usb1_gadget_device = {
|
||||
.name = "r8a66597_udc",
|
||||
.id = 1, /* USB1 */
|
||||
.dev = {
|
||||
.dma_mask = NULL, /* not use dma */
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
.platform_data = &sh7724_usb1_gadget_data,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(sh7724_usb1_gadget_resources),
|
||||
.resource = sh7724_usb1_gadget_resources,
|
||||
};
|
||||
|
||||
static struct platform_device *ms7724se_devices[] __initdata = {
|
||||
@@ -342,6 +398,7 @@ static struct platform_device *ms7724se_devices[] __initdata = {
|
||||
&keysc_device,
|
||||
&sh_eth_device,
|
||||
&sh7724_usb0_host_device,
|
||||
&sh7724_usb1_gadget_device,
|
||||
};
|
||||
|
||||
#define EEPROM_OP 0xBA206000
|
||||
@@ -421,9 +478,38 @@ static int __init devices_setup(void)
|
||||
/* turn on USB clocks, use external clock */
|
||||
ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
/* Let LED9 show STATUS2 */
|
||||
gpio_request(GPIO_FN_STATUS2, NULL);
|
||||
|
||||
/* Lit LED10 show STATUS0 */
|
||||
gpio_request(GPIO_FN_STATUS0, NULL);
|
||||
|
||||
/* Lit LED11 show PDSTATUS */
|
||||
gpio_request(GPIO_FN_PDSTATUS, NULL);
|
||||
#else
|
||||
/* Lit LED9 */
|
||||
gpio_request(GPIO_PTJ6, NULL);
|
||||
gpio_direction_output(GPIO_PTJ6, 1);
|
||||
gpio_export(GPIO_PTJ6, 0);
|
||||
|
||||
/* Lit LED10 */
|
||||
gpio_request(GPIO_PTJ5, NULL);
|
||||
gpio_direction_output(GPIO_PTJ5, 1);
|
||||
gpio_export(GPIO_PTJ5, 0);
|
||||
|
||||
/* Lit LED11 */
|
||||
gpio_request(GPIO_PTJ7, NULL);
|
||||
gpio_direction_output(GPIO_PTJ7, 1);
|
||||
gpio_export(GPIO_PTJ7, 0);
|
||||
#endif
|
||||
|
||||
/* enable USB0 port */
|
||||
ctrl_outw(0x0600, 0xa40501d4);
|
||||
|
||||
/* enable USB1 port */
|
||||
ctrl_outw(0x0600, 0xa4050192);
|
||||
|
||||
/* enable IRQ 0,1,2 */
|
||||
gpio_request(GPIO_FN_INTC_IRQ0, NULL);
|
||||
gpio_request(GPIO_FN_INTC_IRQ1, NULL);
|
||||
@@ -546,15 +632,15 @@ static int __init devices_setup(void)
|
||||
sh_eth_init();
|
||||
|
||||
if (sw & SW41_B) {
|
||||
/* SVGA */
|
||||
lcdc_info.ch[0].lcd_cfg.xres = 800;
|
||||
lcdc_info.ch[0].lcd_cfg.yres = 600;
|
||||
lcdc_info.ch[0].lcd_cfg.left_margin = 142;
|
||||
lcdc_info.ch[0].lcd_cfg.right_margin = 52;
|
||||
lcdc_info.ch[0].lcd_cfg.hsync_len = 96;
|
||||
lcdc_info.ch[0].lcd_cfg.upper_margin = 24;
|
||||
lcdc_info.ch[0].lcd_cfg.lower_margin = 2;
|
||||
lcdc_info.ch[0].lcd_cfg.vsync_len = 2;
|
||||
/* 720p */
|
||||
lcdc_info.ch[0].lcd_cfg.xres = 1280;
|
||||
lcdc_info.ch[0].lcd_cfg.yres = 720;
|
||||
lcdc_info.ch[0].lcd_cfg.left_margin = 220;
|
||||
lcdc_info.ch[0].lcd_cfg.right_margin = 110;
|
||||
lcdc_info.ch[0].lcd_cfg.hsync_len = 40;
|
||||
lcdc_info.ch[0].lcd_cfg.upper_margin = 20;
|
||||
lcdc_info.ch[0].lcd_cfg.lower_margin = 5;
|
||||
lcdc_info.ch[0].lcd_cfg.vsync_len = 5;
|
||||
} else {
|
||||
/* VGA */
|
||||
lcdc_info.ch[0].lcd_cfg.xres = 640;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/irq.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/usb/r8a66597.h>
|
||||
#include <linux/usb/m66592.h>
|
||||
#include <asm/ilsel.h>
|
||||
|
||||
static struct resource heartbeat_resources[] = {
|
||||
@@ -89,6 +90,11 @@ static struct platform_device r8a66597_usb_host_device = {
|
||||
.resource = r8a66597_usb_host_resources,
|
||||
};
|
||||
|
||||
static struct m66592_platdata usbf_platdata = {
|
||||
.xtal = M66592_PLATDATA_XTAL_24MHZ,
|
||||
.vif = 1,
|
||||
};
|
||||
|
||||
static struct resource m66592_usb_peripheral_resources[] = {
|
||||
[0] = {
|
||||
.name = "m66592_udc",
|
||||
@@ -109,6 +115,7 @@ static struct platform_device m66592_usb_peripheral_device = {
|
||||
.dev = {
|
||||
.dma_mask = NULL, /* don't use dma */
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
.platform_data = &usbf_platdata,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(m66592_usb_peripheral_resources),
|
||||
.resource = m66592_usb_peripheral_resources,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
zImage
|
||||
vmlinux.srec
|
||||
uImage
|
||||
uImage.srec
|
||||
vmlinux*
|
||||
uImage*
|
||||
|
||||
+36
-12
@@ -20,8 +20,13 @@ CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
|
||||
CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
|
||||
CONFIG_ENTRY_OFFSET ?= 0x00001000
|
||||
|
||||
targets := zImage vmlinux.srec uImage uImage.srec
|
||||
subdir- := compressed
|
||||
suffix-$(CONFIG_KERNEL_GZIP) := gz
|
||||
suffix-$(CONFIG_KERNEL_BZIP2) := bz2
|
||||
suffix-$(CONFIG_KERNEL_LZMA) := lzma
|
||||
|
||||
targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz uImage.bz2 uImage.lzma
|
||||
extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma
|
||||
subdir- := compressed romimage
|
||||
|
||||
$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
|
||||
$(call if_changed,objcopy)
|
||||
@@ -30,6 +35,13 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
|
||||
$(obj)/compressed/vmlinux: FORCE
|
||||
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
|
||||
|
||||
$(obj)/romImage: $(obj)/romimage/vmlinux FORCE
|
||||
$(call if_changed,objcopy)
|
||||
@echo ' Kernel: $@ is ready'
|
||||
|
||||
$(obj)/romimage/vmlinux: $(obj)/zImage FORCE
|
||||
$(Q)$(MAKE) $(build)=$(obj)/romimage $@
|
||||
|
||||
KERNEL_MEMORY := 0x00000000
|
||||
ifeq ($(CONFIG_PMB_FIXED),y)
|
||||
KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
|
||||
@@ -40,9 +52,6 @@ KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
|
||||
$$[$(CONFIG_MEMORY_START)]')
|
||||
endif
|
||||
|
||||
export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
|
||||
CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY
|
||||
|
||||
KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
|
||||
$$[$(CONFIG_PAGE_OFFSET) + \
|
||||
$(KERNEL_MEMORY) + \
|
||||
@@ -55,19 +64,30 @@ KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
|
||||
|
||||
quiet_cmd_uimage = UIMAGE $@
|
||||
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
|
||||
-C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
|
||||
-C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
|
||||
-n 'Linux-$(KERNELRELEASE)' -d $< $@
|
||||
|
||||
$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
|
||||
$(call if_changed,uimage)
|
||||
@echo ' Image $@ is ready'
|
||||
|
||||
$(obj)/vmlinux.bin: vmlinux FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,gzip)
|
||||
|
||||
$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,bzip2)
|
||||
|
||||
$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,lzma)
|
||||
|
||||
$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
|
||||
$(call if_changed,uimage,bzip2)
|
||||
|
||||
$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
|
||||
$(call if_changed,uimage,gzip)
|
||||
|
||||
$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma
|
||||
$(call if_changed,uimage,lzma)
|
||||
|
||||
OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
|
||||
$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
|
||||
$(call if_changed,objcopy)
|
||||
@@ -76,5 +96,9 @@ OBJCOPYFLAGS_uImage.srec := -I binary -O srec
|
||||
$(obj)/uImage.srec: $(obj)/uImage
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
clean-files += uImage uImage.srec vmlinux.srec \
|
||||
vmlinux.bin vmlinux.bin.gz
|
||||
$(obj)/uImage: $(obj)/uImage.$(suffix-y)
|
||||
@ln -sf $(notdir $<) $@
|
||||
@echo ' Image $@ is ready'
|
||||
|
||||
export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
|
||||
CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY suffix-y
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
vmlinux.bin.*
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user