// SPDX-License-Identifier: GPL-2.01/*2* Copyright (C) 1993 Hamish Macdonald3* Copyright (C) 1999 D. Jeff Dionne4* Copyright (C) 2001 Georges Menie, Ken Desmet5*6* This file is subject to the terms and conditions of the GNU General Public7* License. See the file COPYING in the main directory of this archive8* for more details.9*/10#include <linux/init.h>11#include <asm/machdep.h>12#include <asm/MC68VZ328.h>13#include "m68328.h"14#include "screen.h"1516/***************************************************************************/17/* Init Dragon Engine II hardware */18/***************************************************************************/1920static void dragen2_reset(void)21{22local_irq_disable();2324#ifdef CONFIG_INIT_LCD25PBDATA |= 0x20; /* disable CCFL light */26PKDATA |= 0x4; /* disable LCD controller */27LCKCON = 0;28#endif2930__asm__ __volatile__(31"reset\n\t"32"moveal #0x04000000, %a0\n\t"33"moveal 0(%a0), %sp\n\t"34"moveal 4(%a0), %a0\n\t"35"jmp (%a0)"36);37}3839void __init init_dragen2(char *command, int size)40{41mach_reset = dragen2_reset;4243#ifdef CONFIG_DIRECT_IO_ACCESS44SCR = 0x10; /* allow user access to internal registers */45#endif4647/* CSGB Init */48CSGBB = 0x4000;49CSB = 0x1a1;5051/* CS8900 init */52/* PK3: hardware sleep function pin, active low */53PKSEL |= PK(3); /* select pin as I/O */54PKDIR |= PK(3); /* select pin as output */55PKDATA |= PK(3); /* set pin high */5657/* PF5: hardware reset function pin, active high */58PFSEL |= PF(5); /* select pin as I/O */59PFDIR |= PF(5); /* select pin as output */60PFDATA &= ~PF(5); /* set pin low */6162/* cs8900 hardware reset */63PFDATA |= PF(5);64{ int i; for (i = 0; i < 32000; ++i); }65PFDATA &= ~PF(5);6667/* INT1 enable (cs8900 IRQ) */68PDPOL &= ~PD(1); /* active high signal */69PDIQEG &= ~PD(1);70PDIRQEN |= PD(1); /* IRQ enabled */7172#ifdef CONFIG_INIT_LCD73/* initialize LCD controller */74LSSA = (long) screen_bits;75LVPW = 0x14;76LXMAX = 0x140;77LYMAX = 0xef;78LRRA = 0;79LPXCD = 3;80LPICF = 0x08;81LPOLCF = 0;82LCKCON = 0x80;83PCPDEN = 0xff;84PCSEL = 0;8586/* Enable LCD controller */87PKDIR |= 0x4;88PKSEL |= 0x4;89PKDATA &= ~0x4;9091/* Enable CCFL backlighting circuit */92PBDIR |= 0x20;93PBSEL |= 0x20;94PBDATA &= ~0x20;9596/* contrast control register */97PFDIR |= 0x1;98PFSEL &= ~0x1;99PWMR = 0x037F;100#endif101}102103104