Date:2010-03-12 15:59:15 (10 years 6 months ago)
Author:Juan64Bits
Commit:f494635faf4fa39138d4775879f09101063efb55
Message:Update SAKC kernel.

Files: linux-2.6.32.7_sakc/arch/mips/include/asm/mach-jz4740/board-sakc.h (1 diff)
linux-2.6.32.7_sakc/arch/mips/include/asm/mach-jz4740/jz4740.h (1 diff)
linux-2.6.32.7_sakc/arch/mips/jz4740/Kconfig (1 diff)
linux-2.6.32.7_sakc/arch/mips/jz4740/Makefile (1 diff)
linux-2.6.32.7_sakc/arch/mips/jz4740/board-sakc.c (1 diff)
linux-2.6.32.7_sakc/sound/soc/jz4740/Kconfig (1 diff)

Change Details

linux-2.6.32.7_sakc/arch/mips/include/asm/mach-jz4740/board-sakc.h
1/*
2 * Copyright (c) 2009 Qi Hardware Inc.,
3 * Author: Xiangfu Liu <xiangfu@qi-hardware.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __ASM_JZ4725_SAKC_H__
20#define __ASM_JZ4725_SAKC_H__
21
22#include <linux/gpio.h>
23/*
24 * Frequencies of on-board oscillators
25 */
26#define JZ_EXTAL 12000000 /* Main extal freq: 12 MHz */
27#define JZ_EXTAL_RTC 32768 /* RTC extal freq: 32.768 KHz */
28
29/*
30 * GPIO
31 */
32
33#define GPIO_SD_CD_N JZ_GPIO_PORTC(27)
34
35#endif /* __ASM_JZ4725_SAKC_H__ */
linux-2.6.32.7_sakc/arch/mips/include/asm/mach-jz4740/jz4740.h
1/*
2 * linux/include/asm-mips/mach-jz4740/jz4740.h
3 *
4 * JZ4740 common definition.
5 *
6 * Copyright (C) 2006 - 2007 Ingenic Semiconductor Inc.
7 *
8 * Author: <lhhuang@ingenic.cn>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef __ASM_JZ4740_H__
16#define __ASM_JZ4740_H__
17
18#include <asm/mach-jz4740/regs.h>
19#include <asm/mach-jz4740/dma.h>
20
21/*------------------------------------------------------------------
22 * Platform definitions
23 */
24
25#ifdef CONFIG_JZ4740_QI_LB60
26#include <asm/mach-jz4740/board-qi_lb60.h>
27#endif
28
29#ifdef CONFIG_JZ4725_SAKC
30#include <asm/mach-jz4740/board-sakc.h>
31#endif
32
33/* Add other platform definition here ... */
34
35
36/*------------------------------------------------------------------
37 * Follows are related to platform definitions
38 */
39
40#include <asm/mach-jz4740/serial.h>
41
42#endif /* __ASM_JZ4740_H__ */
linux-2.6.32.7_sakc/arch/mips/jz4740/Kconfig
1choice
2    prompt "Machine type"
3    depends on MACH_JZ
4    default JZ4740_QI_LB60
5
6config JZ4740_QI_LB60
7    bool "Qi Hardware Ben NanoNote"
8    select DMA_NONCOHERENT
9    select SOC_JZ4740
10
11config JZ4725_SAKC
12    bool "Qi Hardware SAKC FPGA board"
13    select DMA_NONCOHERENT
14    select SOC_JZ4740
15
16config JZ4740_N526
17    bool "Hanvon n526 eBook reader"
18    select DMA_NONCOHERENT
19    select SOC_JZ4740
20
21
22endchoice
23
24config SOC_JZ4740
25    bool
26    select JZSOC
27    select GENERIC_GPIO
28    select ARCH_REQUIRE_GPIOLIB
29    select SYS_HAS_EARLY_PRINTK
30    select SYS_SUPPORTS_LITTLE_ENDIAN
31    select IRQ_CPU
32
33config JZSOC
34    bool
35    select JZRISC
36    select SYS_HAS_CPU_MIPS32_R1
37    select SYS_SUPPORTS_32BIT_KERNEL
38
39config JZRISC
40    bool
linux-2.6.32.7_sakc/arch/mips/jz4740/Makefile
1#
2# Makefile for the Ingenic JZ4740.
3#
4
5# Object file lists.
6
7obj-y += prom.o irq.o time.o reset.o setup.o dma.o \
8    gpio.o clock.o platform.o
9
10obj-$(CONFIG_DEBUG_FS) += clock-debugfs.o
11
12# board specific support
13
14obj-$(CONFIG_JZ4740_QI_LB60) += board-qi_lb60.o
15obj-$(CONFIG_JZ4740_N526) += board-n526.o
16obj-$(CONFIG_JZ4725_SAKC) += board-sakc.o
17
18# PM support
19
20obj-$(CONFIG_PM) +=pm.o
21
linux-2.6.32.7_sakc/arch/mips/jz4740/board-sakc.c
1/*
2 * linux/arch/mips/jz4740/board-sakc.c
3 *
4 * SAKC setup routines, based on QI_LB60
5 *
6 * Copyright (c) 2009 Qi Hardware inc.,
7 * Author: Xiangfu Liu <xiangfu@qi-hardware.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 or later
11 * as published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/gpio.h>
17
18#include <asm/mach-jz4740/board-sakc.h>
19#include <asm/mach-jz4740/platform.h>
20
21#include <linux/input.h>
22//#include <linux/gpio_keys.h>
23#include <linux/mtd/jz4740_nand.h>
24#include <linux/jz4740_fb.h>
25//#include <linux/input/matrix_keypad.h>
26#include <linux/mtd/jz4740_nand.h>
27#include <linux/spi/spi.h>
28#include <linux/spi/spi_gpio.h>
29//#include <linux/power_supply.h>
30//#include <linux/power/jz4740-battery.h>
31//#include <linux/power/gpio-charger.h>
32#include <linux/mmc/jz4740_mmc.h>
33
34
35/* NAND */
36static struct nand_ecclayout sakc_ecclayout_1gb = {
37    .eccbytes = 36,
38    .eccpos = {
39        6, 7, 8, 9, 10, 11, 12, 13,
40        14, 15, 16, 17, 18, 19, 20, 21,
41        22, 23, 24, 25, 26, 27, 28, 29,
42        30, 31, 32, 33, 34, 35, 36, 37,
43        38, 39, 40, 41},
44    .oobfree = {
45        {.offset = 2,
46         .length = 4},
47        {.offset = 42,
48         .length = 22}}
49};
50
51static struct mtd_partition sakc_partitions_1gb[] = {
52    { .name = "NAND BOOT partition",
53      .offset = 0 * 0x100000,
54      .size = 4 * 0x100000,
55     },
56    { .name = "NAND KERNEL partition",
57      .offset = 4 * 0x100000,
58      .size = 4 * 0x100000,
59     },
60    { .name = "NAND ROOTFS partition",
61      .offset = 8 * 0x100000,
62      .size = (504 + 512) * 0x100000,
63     },
64};
65
66static struct nand_ecclayout sakc_ecclayout_2gb = {
67    .eccbytes = 72,
68    .eccpos = {
69        12, 13, 14, 15, 16, 17, 18, 19,
70        20, 21, 22, 23, 24, 25, 26, 27,
71        28, 29, 30, 31, 32, 33, 34, 35,
72        36, 37, 38, 39, 40, 41, 42, 43,
73        44, 45, 46, 47, 48, 49, 50, 51,
74        52, 53, 54, 55, 56, 57, 58, 59,
75        60, 61, 62, 63, 64, 65, 66, 67,
76        68, 69, 70, 71, 72, 73, 74, 75,
77        76, 77, 78, 79, 80, 81, 82, 83},
78    .oobfree = {
79         {.offset = 2,
80         .length = 10},
81        {.offset = 84,
82         .length = 44}}
83};
84
85static struct mtd_partition sakc_partitions_2gb[] = {
86    { .name = "NAND BOOT partition",
87      .offset = 0 * 0x100000,
88      .size = 4 * 0x100000,
89     },
90    { .name = "NAND KERNEL partition",
91      .offset = 4 * 0x100000,
92      .size = 4 * 0x100000,
93     },
94    { .name = "NAND ROOTFS partition",
95      .offset = 8 * 0x100000,
96      .size = (504 + 512 + 1024) * 0x100000,
97     },
98};
99
100static void sakc_nand_ident(struct platform_device *pdev,
101                struct nand_chip *chip,
102                struct mtd_partition **partitions,
103                int *num_partitions)
104{
105    if (chip->page_shift == 12) {
106        chip->ecc.layout = &sakc_ecclayout_2gb;
107        *partitions = sakc_partitions_2gb;
108        *num_partitions = ARRAY_SIZE(sakc_partitions_2gb);
109    } else {
110        chip->ecc.layout = &sakc_ecclayout_1gb;
111        *partitions = sakc_partitions_1gb;
112        *num_partitions = ARRAY_SIZE(sakc_partitions_1gb);
113    }
114}
115
116static struct jz_nand_platform_data sakc_nand_pdata = {
117    .ident_callback = sakc_nand_ident,
118    .busy_gpio = 94,
119};
120
121
122/* Display */
123static struct fb_videomode sakc_video_modes[] = {
124    {
125        .name = "320x240",
126        .xres = 320,
127        .yres = 240,
128        .pixclock = 700000,
129        .left_margin = 140,
130        .right_margin = 273,
131        .upper_margin = 20,
132        .lower_margin = 2,
133        .hsync_len = 1,
134        .vsync_len = 1,
135        .sync = 0,
136        .vmode = FB_VMODE_NONINTERLACED,
137    },
138};
139
140static struct jz4740_fb_platform_data sakc_fb_pdata = {
141    .width = 60,
142    .height = 45,
143    .num_modes = ARRAY_SIZE(sakc_video_modes),
144    .modes = sakc_video_modes,
145    .bpp = 24,
146    .lcd_type = JZ_LCD_TYPE_8BIT_SERIAL,
147};
148
149
150struct spi_gpio_platform_data spigpio_platform_data = {
151    .sck = JZ_GPIO_PORTC(23),
152    .mosi = JZ_GPIO_PORTC(22),
153    .miso = JZ_GPIO_PORTC(22),
154    .num_chipselect = 1,
155};
156
157static struct platform_device spigpio_device = {
158    .name = "spi_gpio",
159    .id = 1,
160    .dev = {
161        .platform_data = &spigpio_platform_data,
162    },
163};
164
165static struct spi_board_info sakc_spi_board_info[] = {
166    {
167        .modalias = "gpm940b0",
168        .controller_data = (void*)JZ_GPIO_PORTC(21),
169        .chip_select = 0,
170        .bus_num = 1,
171        .max_speed_hz = 30 * 1000,
172    },
173};
174
175/* MMC */
176
177static struct jz4740_mmc_platform_data sakc_mmc_pdata = {
178    .gpio_card_detect = JZ_GPIO_PORTC(27),
179    .gpio_read_only = -1,
180    .gpio_power = -1,
181    .power_active_low = 1,
182    .data_1bit = 1,
183};
184
185static struct platform_device *jz_platform_devices[] __initdata = {
186    &jz4740_usb_ohci_device,
187    &jz4740_usb_gdt_device,
188    &jz4740_mmc_device,
189    &jz4740_nand_device,
190    &spigpio_device,
191    &jz4740_framebuffer_device,
192    &jz4740_i2s_device,
193    &jz4740_codec_device,
194    &jz4740_rtc_device,
195    &jz4740_adc_device,
196};
197
198static void __init board_gpio_setup(void)
199{
200    /* We only need to enable/disable pullup here for pins used in generic
201     * drivers. Everything else is done by the drivers themselfs. */
202    jz_gpio_disable_pullup(GPIO_SD_CD_N);
203}
204
205static int __init sakc_init_platform_devices(void)
206{
207    jz4740_framebuffer_device.dev.platform_data = &sakc_fb_pdata;
208    jz4740_nand_device.dev.platform_data = &sakc_nand_pdata;
209    jz4740_mmc_device.dev.platform_data = &sakc_mmc_pdata;
210
211    spi_register_board_info(sakc_spi_board_info,
212                ARRAY_SIZE(sakc_spi_board_info));
213
214    return platform_add_devices(jz_platform_devices,
215                    ARRAY_SIZE(jz_platform_devices));
216
217}
218extern int jz_gpiolib_init(void);
219extern int jz_init_clocks(unsigned long extal);
220
221static __init int board_sakc(char *str)
222{
223    sakc_mmc_pdata.card_detect_active_low = 1;
224
225    return 1;
226}
227
228__setup("sakc", board_sakc);
229
230static int __init sakc_board_setup(void)
231{
232    printk("Qi Hardware JZ4725 SAKC setup\n");
233    if (jz_gpiolib_init())
234        panic("Failed to initalize jz gpio\n");
235    jz_init_clocks(12000000);
236
237    board_gpio_setup();
238
239    if (sakc_init_platform_devices())
240        panic("Failed to initalize platform devices\n");
241
242    return 0;
243}
244
245arch_initcall(sakc_board_setup);
linux-2.6.32.7_sakc/sound/soc/jz4740/Kconfig
1config SND_JZ4740_SOC
2    tristate "SoC Audio for Ingenic JZ4740 SoC"
3    depends on SOC_JZ4740 && SND_SOC
4    help
5      Say Y or M if you want to add support for codecs attached to
6      the Jz4740 AC97, I2S or SSP interface. You will also need
7      to select the audio interfaces to support below.
8
9config SND_JZ4740_SOC_QI_LB60
10    tristate "SoC Audio support for Qi Hardware Ben Nanonote"
11    depends on SND_JZ4740_SOC && JZ4740_QI_LB60
12    select SND_JZ4740_SOC_I2S
13    select SND_SOC_JZCODEC
14    help
15      Say Y if you want to add support for SoC audio of internal codec on Ingenic Jz4740 QI_LB60 board.
16
17config SND_JZ4740_SOC_N526
18    tristate "SoC Audio support for Hanvon N526 eBook reader"
19    depends on SND_JZ4740_SOC && JZ4740_N526
20    select SND_JZ4740_SOC_I2S
21    select SND_SOC_JZCODEC
22    help
23      Say Y if you want to enable support for SoC audio on the Hanvon N526.
24
25config SND_JZ4740_SOC_I2S
26    depends on SND_JZ4740_SOC
27    tristate "SoC Audio (I2S protocol) for Ingenic jz4740 chip"
28    help
29      Say Y if you want to use I2S protocol and I2S codec on Ingenic Jz4740 QI_LB60 board.

Archive Download the corresponding diff file

Branches:
master



interactive