Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
[deliverable/linux.git] / arch / arm / mach-shmobile / board-bockw-reference.c
CommitLineData
cfa66a81
KM
1/*
2 * Bock-W board support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
cfa66a81
KM
15 */
16
17#include <linux/of_platform.h>
02c94f38 18
cfa66a81 19#include <asm/mach/arch.h>
02c94f38 20
fd44aa5e 21#include "common.h"
02c94f38 22#include "r8a7778.h"
cfa66a81
KM
23
24/*
25 * see board-bock.c for checking detail of dip-switch
26 */
27
90357fcb
KM
28#define FPGA 0x18200000
29#define IRQ0MR 0x30
30#define COMCTLR 0x101c
79990c16
KM
31
32#define PFC 0xfffc0000
33#define PUPR4 0x110
cfa66a81
KM
34static void __init bockw_init(void)
35{
b6d3eba3 36 void __iomem *fpga;
79990c16 37 void __iomem *pfc;
90357fcb 38
cfa66a81 39 r8a7778_clock_init();
90357fcb 40 r8a7778_init_irq_extpin_dt(1);
cfa66a81
KM
41 r8a7778_add_dt_devices();
42
90357fcb
KM
43 fpga = ioremap_nocache(FPGA, SZ_1M);
44 if (fpga) {
45 /*
46 * CAUTION
47 *
48 * IRQ0/1 is cascaded interrupt from FPGA.
49 * it should be cared in the future
50 * Now, it is assuming IRQ0 was used only from SMSC.
51 */
52 u16 val = ioread16(fpga + IRQ0MR);
53 val &= ~(1 << 4); /* enable SMSC911x */
54 iowrite16(val, fpga + IRQ0MR);
b6d3eba3
KM
55
56 iounmap(fpga);
90357fcb
KM
57 }
58
79990c16
KM
59 pfc = ioremap_nocache(PFC, 0x200);
60 if (pfc) {
61 /*
62 * FIXME
63 *
64 * SDHI CD/WP pin needs pull-up
65 */
66 iowrite32(ioread32(pfc + PUPR4) | (3 << 26), pfc + PUPR4);
67 iounmap(pfc);
90357fcb
KM
68 }
69
cfa66a81
KM
70 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
71}
72
73static const char *bockw_boards_compat_dt[] __initdata = {
74 "renesas,bockw-reference",
75 NULL,
76};
77
78DT_MACHINE_START(BOCKW_DT, "bockw")
ca609e66 79 .init_early = shmobile_init_delay,
cfa66a81
KM
80 .init_irq = r8a7778_init_irq_dt,
81 .init_machine = bockw_init,
6e15a387 82 .init_late = shmobile_init_late,
cfa66a81
KM
83 .dt_compat = bockw_boards_compat_dt,
84MACHINE_END
This page took 0.076178 seconds and 5 git commands to generate.