Path: blob/master/arch/m68k/platform/68VZ328/config.c
10818 views
/***************************************************************************/12/*3* linux/arch/m68knommu/platform/68VZ328/config.c4*5* Copyright (C) 1993 Hamish Macdonald6* Copyright (C) 1999 D. Jeff Dionne7* Copyright (C) 2001 Georges Menie, Ken Desmet8*9* This file is subject to the terms and conditions of the GNU General Public10* License. See the file COPYING in the main directory of this archive11* for more details.12*/1314/***************************************************************************/1516#include <linux/types.h>17#include <linux/kernel.h>18#include <linux/kd.h>19#include <linux/netdevice.h>20#include <linux/interrupt.h>21#include <linux/irq.h>2223#include <asm/system.h>24#include <asm/pgtable.h>25#include <asm/machdep.h>26#include <asm/MC68VZ328.h>27#include <asm/bootstd.h>2829#ifdef CONFIG_INIT_LCD30#include "bootlogo.h"31#endif3233/***************************************************************************/3435void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);3637/***************************************************************************/38/* Init Drangon Engine hardware */39/***************************************************************************/40#if defined(CONFIG_DRAGEN2)4142static void m68vz328_reset(void)43{44local_irq_disable();4546#ifdef CONFIG_INIT_LCD47PBDATA |= 0x20; /* disable CCFL light */48PKDATA |= 0x4; /* disable LCD controller */49LCKCON = 0;50#endif5152__asm__ __volatile__(53"reset\n\t"54"moveal #0x04000000, %a0\n\t"55"moveal 0(%a0), %sp\n\t"56"moveal 4(%a0), %a0\n\t"57"jmp (%a0)"58);59}6061static void init_hardware(char *command, int size)62{63#ifdef CONFIG_DIRECT_IO_ACCESS64SCR = 0x10; /* allow user access to internal registers */65#endif6667/* CSGB Init */68CSGBB = 0x4000;69CSB = 0x1a1;7071/* CS8900 init */72/* PK3: hardware sleep function pin, active low */73PKSEL |= PK(3); /* select pin as I/O */74PKDIR |= PK(3); /* select pin as output */75PKDATA |= PK(3); /* set pin high */7677/* PF5: hardware reset function pin, active high */78PFSEL |= PF(5); /* select pin as I/O */79PFDIR |= PF(5); /* select pin as output */80PFDATA &= ~PF(5); /* set pin low */8182/* cs8900 hardware reset */83PFDATA |= PF(5);84{ int i; for (i = 0; i < 32000; ++i); }85PFDATA &= ~PF(5);8687/* INT1 enable (cs8900 IRQ) */88PDPOL &= ~PD(1); /* active high signal */89PDIQEG &= ~PD(1);90PDIRQEN |= PD(1); /* IRQ enabled */9192#ifdef CONFIG_INIT_LCD93/* initialize LCD controller */94LSSA = (long) screen_bits;95LVPW = 0x14;96LXMAX = 0x140;97LYMAX = 0xef;98LRRA = 0;99LPXCD = 3;100LPICF = 0x08;101LPOLCF = 0;102LCKCON = 0x80;103PCPDEN = 0xff;104PCSEL = 0;105106/* Enable LCD controller */107PKDIR |= 0x4;108PKSEL |= 0x4;109PKDATA &= ~0x4;110111/* Enable CCFL backlighting circuit */112PBDIR |= 0x20;113PBSEL |= 0x20;114PBDATA &= ~0x20;115116/* contrast control register */117PFDIR |= 0x1;118PFSEL &= ~0x1;119PWMR = 0x037F;120#endif121}122123/***************************************************************************/124/* Init RT-Control uCdimm hardware */125/***************************************************************************/126#elif defined(CONFIG_UCDIMM)127128static void m68vz328_reset(void)129{130local_irq_disable();131asm volatile (132"moveal #0x10c00000, %a0;\n\t"133"moveb #0, 0xFFFFF300;\n\t"134"moveal 0(%a0), %sp;\n\t"135"moveal 4(%a0), %a0;\n\t"136"jmp (%a0);\n"137);138}139140unsigned char *cs8900a_hwaddr;141static int errno;142143_bsc0(char *, getserialnum)144_bsc1(unsigned char *, gethwaddr, int, a)145_bsc1(char *, getbenv, char *, a)146147static void init_hardware(char *command, int size)148{149char *p;150151printk(KERN_INFO "uCdimm serial string [%s]\n", getserialnum());152p = cs8900a_hwaddr = gethwaddr(0);153printk(KERN_INFO "uCdimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",154p[0], p[1], p[2], p[3], p[4], p[5]);155p = getbenv("APPEND");156if (p)157strcpy(p, command);158else159command[0] = 0;160}161162/***************************************************************************/163#else164165static void m68vz328_reset(void)166{167}168169static void init_hardware(char *command, int size)170{171}172173/***************************************************************************/174#endif175/***************************************************************************/176177void config_BSP(char *command, int size)178{179printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");180181init_hardware(command, size);182183mach_gettod = m68328_timer_gettod;184mach_reset = m68vz328_reset;185}186187/***************************************************************************/188189190