1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-12 05:12:49 +02:00
openwrt-xburst/target/linux/xburst/files-2.6.27/arch/mips/jz4740/board-dipper.c
Mirko Vogt dc3d3f1c49 yet another patchset - 2.6.27
it's basically also provided by ingenic and nativly based on 2.6.27,
adjusted to fit into the OpenWrt-environment
2009-10-28 03:13:11 +08:00

118 lines
2.0 KiB
C

/*
* linux/arch/mips/jz4740/board-dipper.c
*
* JZ4725 Dipper board setup routines.
*
* Copyright (c) 2006-2007 Ingenic Semiconductor Inc.
* Author: <lhhuang@ingenic.cn>
*
* 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/init.h>
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/mm.h>
#include <linux/console.h>
#include <linux/delay.h>
#include <asm/cpu.h>
#include <asm/bootinfo.h>
#include <asm/mipsregs.h>
#include <asm/reboot.h>
#include <asm/jzsoc.h>
extern void (*jz_timer_callback)(void);
#if 0
static void dancing(void)
{
static unsigned int count = 0;
count ++;
count &= 1;
if (count)
__gpio_set_pin(GPIO_LED_EN);
else
__gpio_clear_pin(GPIO_LED_EN);
}
#endif
static void dipper_timer_callback(void)
{
static unsigned long count = 0;
if ((++count) % 50 == 0) {
// dancing();
count = 0;
}
}
static void __init board_cpm_setup(void)
{
/* Stop unused module clocks here.
* We have started all module clocks at arch/mips/jz4740/setup.c.
*/
}
static void __init board_gpio_setup(void)
{
/*
* Most of the GPIO pins should have been initialized by the boot-loader
*/
/*
* Initialize MSC pins
*/
__gpio_as_msc();
/*
* Initialize Smart LCD pins
*/
// __gpio_as_slcd_18bit();
/*
* Initialize SSI pins
*/
__gpio_as_ssi();
/*
* Initialize I2C pins
*/
__gpio_as_i2c();
/*
* Initialize Other pins
*/
__gpio_as_output(GPIO_SD_VCC_EN_N);
__gpio_clear_pin(GPIO_SD_VCC_EN_N);
__gpio_as_input(GPIO_SD_CD_N);
__gpio_disable_pull(GPIO_SD_CD_N);
__gpio_as_input(GPIO_SD_WP);
__gpio_disable_pull(GPIO_SD_WP);
__gpio_as_input(GPIO_DC_DETE_N);
__gpio_as_input(GPIO_CHARG_STAT_N);
__gpio_as_input(GPIO_USB_DETE);
__gpio_as_output(GPIO_DISP_OFF_N);
// __gpio_as_output(GPIO_LED_EN);
}
void __init jz_board_setup(void)
{
printk("JZ4725 DIPPER board setup\n");
board_cpm_setup();
board_gpio_setup();
jz_timer_callback = dipper_timer_callback;
}