Skip to content

Commit 49fb2cd

Browse files
committed
Merge branch 'master' into sh/st-integration
2 parents dfc3494 + 260af56 commit 49fb2cd

124 files changed

Lines changed: 4198 additions & 2110 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/sh/Kconfig‎

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ config SUPERH
1616
select HAVE_IOREMAP_PROT if MMU
1717
select HAVE_ARCH_TRACEHOOK
1818
select HAVE_DMA_API_DEBUG
19+
select HAVE_DMA_ATTRS
1920
select HAVE_PERF_EVENTS
21+
select PERF_USE_VMALLOC
2022
select HAVE_KERNEL_GZIP
2123
select HAVE_KERNEL_BZIP2
2224
select HAVE_KERNEL_LZMA
@@ -37,6 +39,7 @@ config SUPERH32
3739
select HAVE_FTRACE_MCOUNT_RECORD
3840
select HAVE_DYNAMIC_FTRACE
3941
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
42+
select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE
4043
select HAVE_FUNCTION_GRAPH_TRACER
4144
select HAVE_ARCH_KGDB
4245
select ARCH_HIBERNATION_POSSIBLE if MMU
@@ -170,6 +173,12 @@ config ARCH_HAS_CPU_IDLE_WAIT
170173
config IO_TRAPPED
171174
bool
172175

176+
config DMA_COHERENT
177+
bool
178+
179+
config DMA_NONCOHERENT
180+
def_bool !DMA_COHERENT
181+
173182
source "init/Kconfig"
174183

175184
source "kernel/Kconfig.freezer"
@@ -220,6 +229,7 @@ config CPU_SHX2
220229

221230
config CPU_SHX3
222231
bool
232+
select DMA_COHERENT
223233

224234
config ARCH_SHMOBILE
225235
bool
@@ -761,17 +771,6 @@ config ENTRY_OFFSET
761771
default "0x00010000" if PAGE_SIZE_64KB
762772
default "0x00000000"
763773

764-
config UBC_WAKEUP
765-
bool "Wakeup UBC on startup"
766-
depends on CPU_SH4 && !CPU_SH4A
767-
help
768-
Selecting this option will wakeup the User Break Controller (UBC) on
769-
startup. Although the UBC is left in an awake state when the processor
770-
comes up, some boot loaders misbehave by putting the UBC to sleep in a
771-
power saving state, which causes issues with things like ptrace().
772-
773-
If unsure, say N.
774-
775774
choice
776775
prompt "Kernel command line"
777776
optional
@@ -818,7 +817,13 @@ config MAPLE
818817
Dreamcast with a serial line terminal or a remote network
819818
connection.
820819

821-
source "arch/sh/drivers/pci/Kconfig"
820+
config PCI
821+
bool "PCI support"
822+
depends on SYS_SUPPORTS_PCI
823+
help
824+
Find out whether you have a PCI motherboard. PCI is the name of a
825+
bus system, i.e. the way the CPU talks to the other stuff inside
826+
your box. If you have PCI, say Y, otherwise N.
822827

823828
source "drivers/pci/pcie/Kconfig"
824829

‎arch/sh/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ machdir-$(CONFIG_SH_7751_SYSTEMH) += mach-systemh
136136
machdir-$(CONFIG_SH_EDOSK7705) += mach-edosk7705
137137
machdir-$(CONFIG_SH_HIGHLANDER) += mach-highlander
138138
machdir-$(CONFIG_SH_MIGOR) += mach-migor
139+
machdir-$(CONFIG_SH_AP325RXA) += mach-ap325rxa
139140
machdir-$(CONFIG_SH_KFR2R09) += mach-kfr2r09
140141
machdir-$(CONFIG_SH_ECOVEC) += mach-ecovec24
141142
machdir-$(CONFIG_SH_SDK7780) += mach-sdk7780

‎arch/sh/boards/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#
22
# Specific board support, not covered by a mach group.
33
#
4-
obj-$(CONFIG_SH_AP325RXA) += board-ap325rxa.o
54
obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o
65
obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o
76
obj-$(CONFIG_SH_URQUELL) += board-urquell.o
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
obj-y := setup.o sdram.o
2+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* AP325RXA sdram self/auto-refresh setup code
3+
*
4+
* Copyright (C) 2009 Magnus Damm
5+
*
6+
* This file is subject to the terms and conditions of the GNU General Public
7+
* License. See the file "COPYING" in the main directory of this archive
8+
* for more details.
9+
*/
10+
11+
#include <linux/sys.h>
12+
#include <linux/errno.h>
13+
#include <linux/linkage.h>
14+
#include <asm/asm-offsets.h>
15+
#include <asm/suspend.h>
16+
#include <asm/romimage-macros.h>
17+
18+
/* code to enter and leave self-refresh. must be self-contained.
19+
* this code will be copied to on-chip memory and executed from there.
20+
*/
21+
.balign 4
22+
ENTRY(ap325rxa_sdram_enter_start)
23+
24+
/* SBSC: disable power down and put in self-refresh mode */
25+
mov.l 1f, r4
26+
mov.l 2f, r1
27+
mov.l @r4, r2
28+
or r1, r2
29+
mov.l 3f, r3
30+
and r3, r2
31+
mov.l r2, @r4
32+
33+
rts
34+
nop
35+
36+
.balign 4
37+
1: .long 0xfe400008 /* SDCR0 */
38+
2: .long 0x00000400
39+
3: .long 0xffff7fff
40+
ENTRY(ap325rxa_sdram_enter_end)
41+
42+
.balign 4
43+
ENTRY(ap325rxa_sdram_leave_start)
44+
45+
/* SBSC: set auto-refresh mode */
46+
mov.l 1f, r4
47+
mov.l @r4, r0
48+
mov.l 4f, r1
49+
and r1, r0
50+
mov.l r0, @r4
51+
mov.l 6f, r4
52+
mov.l 8f, r0
53+
mov.l @r4, r1
54+
mov #-1, r4
55+
add r4, r1
56+
or r1, r0
57+
mov.l 7f, r1
58+
mov.l r0, @r1
59+
60+
rts
61+
nop
62+
63+
.balign 4
64+
1: .long 0xfe400008 /* SDCR0 */
65+
4: .long 0xfffffbff
66+
6: .long 0xfe40001c /* RTCOR */
67+
7: .long 0xfe400018 /* RTCNT */
68+
8: .long 0xa55a0000
69+
ENTRY(ap325rxa_sdram_leave_end)
Lines changed: 74 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@
2020
#include <linux/i2c.h>
2121
#include <linux/smsc911x.h>
2222
#include <linux/gpio.h>
23-
#include <linux/spi/spi.h>
24-
#include <linux/spi/spi_gpio.h>
2523
#include <media/ov772x.h>
2624
#include <media/soc_camera.h>
2725
#include <media/soc_camera_platform.h>
2826
#include <media/sh_mobile_ceu.h>
2927
#include <video/sh_mobile_lcdc.h>
3028
#include <asm/io.h>
3129
#include <asm/clock.h>
30+
#include <asm/suspend.h>
3231
#include <cpu/sh7723.h>
3332

3433
static struct smsc911x_platform_config smsc911x_config = {
@@ -409,17 +408,49 @@ static struct platform_device ceu_device = {
409408
},
410409
};
411410

412-
struct spi_gpio_platform_data sdcard_cn3_platform_data = {
413-
.sck = GPIO_PTD0,
414-
.mosi = GPIO_PTD1,
415-
.miso = GPIO_PTD2,
416-
.num_chipselect = 1,
411+
static struct resource sdhi0_cn3_resources[] = {
412+
[0] = {
413+
.name = "SDHI0",
414+
.start = 0x04ce0000,
415+
.end = 0x04ce01ff,
416+
.flags = IORESOURCE_MEM,
417+
},
418+
[1] = {
419+
.start = 101,
420+
.flags = IORESOURCE_IRQ,
421+
},
417422
};
418423

419-
static struct platform_device sdcard_cn3_device = {
420-
.name = "spi_gpio",
421-
.dev = {
422-
.platform_data = &sdcard_cn3_platform_data,
424+
static struct platform_device sdhi0_cn3_device = {
425+
.name = "sh_mobile_sdhi",
426+
.id = 0, /* "sdhi0" clock */
427+
.num_resources = ARRAY_SIZE(sdhi0_cn3_resources),
428+
.resource = sdhi0_cn3_resources,
429+
.archdata = {
430+
.hwblk_id = HWBLK_SDHI0,
431+
},
432+
};
433+
434+
static struct resource sdhi1_cn7_resources[] = {
435+
[0] = {
436+
.name = "SDHI1",
437+
.start = 0x04cf0000,
438+
.end = 0x04cf01ff,
439+
.flags = IORESOURCE_MEM,
440+
},
441+
[1] = {
442+
.start = 24,
443+
.flags = IORESOURCE_IRQ,
444+
},
445+
};
446+
447+
static struct platform_device sdhi1_cn7_device = {
448+
.name = "sh_mobile_sdhi",
449+
.id = 1, /* "sdhi1" clock */
450+
.num_resources = ARRAY_SIZE(sdhi1_cn7_resources),
451+
.resource = sdhi1_cn7_resources,
452+
.archdata = {
453+
.hwblk_id = HWBLK_SDHI1,
423454
},
424455
};
425456

@@ -470,22 +501,26 @@ static struct platform_device *ap325rxa_devices[] __initdata = {
470501
&lcdc_device,
471502
&ceu_device,
472503
&nand_flash_device,
473-
&sdcard_cn3_device,
504+
&sdhi0_cn3_device,
505+
&sdhi1_cn7_device,
474506
&ap325rxa_camera[0],
475507
&ap325rxa_camera[1],
476508
};
477509

478-
static struct spi_board_info ap325rxa_spi_devices[] = {
479-
{
480-
.modalias = "mmc_spi",
481-
.max_speed_hz = 5000000,
482-
.chip_select = 0,
483-
.controller_data = (void *) GPIO_PTD5,
484-
},
485-
};
510+
extern char ap325rxa_sdram_enter_start;
511+
extern char ap325rxa_sdram_enter_end;
512+
extern char ap325rxa_sdram_leave_start;
513+
extern char ap325rxa_sdram_leave_end;
486514

487515
static int __init ap325rxa_devices_setup(void)
488516
{
517+
/* register board specific self-refresh code */
518+
sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF,
519+
&ap325rxa_sdram_enter_start,
520+
&ap325rxa_sdram_enter_end,
521+
&ap325rxa_sdram_leave_start,
522+
&ap325rxa_sdram_leave_end);
523+
489524
/* LD3 and LD4 LEDs */
490525
gpio_request(GPIO_PTX5, NULL); /* RUN */
491526
gpio_direction_output(GPIO_PTX5, 1);
@@ -578,12 +613,28 @@ static int __init ap325rxa_devices_setup(void)
578613

579614
platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
580615

616+
/* SDHI0 - CN3 - SD CARD */
617+
gpio_request(GPIO_FN_SDHI0CD_PTD, NULL);
618+
gpio_request(GPIO_FN_SDHI0WP_PTD, NULL);
619+
gpio_request(GPIO_FN_SDHI0D3_PTD, NULL);
620+
gpio_request(GPIO_FN_SDHI0D2_PTD, NULL);
621+
gpio_request(GPIO_FN_SDHI0D1_PTD, NULL);
622+
gpio_request(GPIO_FN_SDHI0D0_PTD, NULL);
623+
gpio_request(GPIO_FN_SDHI0CMD_PTD, NULL);
624+
gpio_request(GPIO_FN_SDHI0CLK_PTD, NULL);
625+
626+
/* SDHI1 - CN7 - MICRO SD CARD */
627+
gpio_request(GPIO_FN_SDHI1CD, NULL);
628+
gpio_request(GPIO_FN_SDHI1D3, NULL);
629+
gpio_request(GPIO_FN_SDHI1D2, NULL);
630+
gpio_request(GPIO_FN_SDHI1D1, NULL);
631+
gpio_request(GPIO_FN_SDHI1D0, NULL);
632+
gpio_request(GPIO_FN_SDHI1CMD, NULL);
633+
gpio_request(GPIO_FN_SDHI1CLK, NULL);
634+
581635
i2c_register_board_info(0, ap325rxa_i2c_devices,
582636
ARRAY_SIZE(ap325rxa_i2c_devices));
583637

584-
spi_register_board_info(ap325rxa_spi_devices,
585-
ARRAY_SIZE(ap325rxa_spi_devices));
586-
587638
return platform_add_devices(ap325rxa_devices,
588639
ARRAY_SIZE(ap325rxa_devices));
589640
}

‎arch/sh/boards/mach-ecovec24/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# for more details.
77
#
88

9-
obj-y := setup.o
9+
obj-y := setup.o sdram.o
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Ecovec24 sdram self/auto-refresh setup code
3+
*
4+
* Copyright (C) 2009 Magnus Damm
5+
*
6+
* This file is subject to the terms and conditions of the GNU General Public
7+
* License. See the file "COPYING" in the main directory of this archive
8+
* for more details.
9+
*/
10+
11+
#include <linux/sys.h>
12+
#include <linux/errno.h>
13+
#include <linux/linkage.h>
14+
#include <asm/asm-offsets.h>
15+
#include <asm/suspend.h>
16+
#include <asm/romimage-macros.h>
17+
18+
/* code to enter and leave self-refresh. must be self-contained.
19+
* this code will be copied to on-chip memory and executed from there.
20+
*/
21+
.balign 4
22+
ENTRY(ecovec24_sdram_enter_start)
23+
24+
/* DBSC: put memory in self-refresh mode */
25+
26+
ED 0xFD000010, 0x00000000 /* DBEN */
27+
ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
28+
ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
29+
ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
30+
ED 0xFD000040, 0x00000001 /* DBRFPDN0 */
31+
32+
rts
33+
nop
34+
35+
ENTRY(ecovec24_sdram_enter_end)
36+
37+
.balign 4
38+
ENTRY(ecovec24_sdram_leave_start)
39+
40+
/* DBSC: put memory in auto-refresh mode */
41+
42+
ED 0xFD000040, 0x00000000 /* DBRFPDN0 */
43+
WAIT 1
44+
ED 0xFD000014, 0x00000002 /* DBCMDCNT (PALL) */
45+
ED 0xFD000014, 0x00000004 /* DBCMDCNT (REF) */
46+
ED 0xFD000010, 0x00000001 /* DBEN */
47+
ED 0xFD000040, 0x00010000 /* DBRFPDN0 */
48+
49+
rts
50+
nop
51+
52+
ENTRY(ecovec24_sdram_leave_end)

0 commit comments

Comments
 (0)