1 /*
2  *
3  *    Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
4  *
5  *    Copyright 2000 MontaVista Software Inc.
6  *	PPC405 modifications
7  * 	Author: MontaVista Software, Inc.
8  *         	frank_rowand@mvista.com or source@mvista.com
9  * 	   	debbie_chu@mvista.com
10  *
11  *    Module name: ppc405.h
12  *
13  *    Description:
14  *      Macros, definitions, and data structures specific to the IBM PowerPC
15  *      based boards.
16  *
17  *      This includes:
18  *
19  *         405GP "Walnut" evaluation board
20  *
21  * Please read the COPYING file for all license details.
22  */
23 
24 #ifdef __KERNEL__
25 #ifndef __ASM_WALNUT_H__
26 #define __ASM_WALNUT_H__
27 
28 /* We have a 405GP core */
29 #include <platforms/ibm405gp.h>
30 
31 #ifndef __ASSEMBLY__
32 /*
33  * Data structure defining board information maintained by the boot
34  * ROM on IBM's "Walnut" evaluation board. An effort has been made to
35  * keep the field names consistent with the 8xx 'bd_t' board info
36  * structures.
37  */
38 
39 typedef struct board_info {
40 	unsigned char	 bi_s_version[4];	/* Version of this structure */
41 	unsigned char	 bi_r_version[30];	/* Version of the IBM ROM */
42 	unsigned int	 bi_memsize;		/* DRAM installed, in bytes */
43 	unsigned char	 bi_enetaddr[6];	/* Local Ethernet MAC address */
44 	unsigned char	 bi_pci_enetaddr[6];	/* PCI Ethernet MAC address */
45 	unsigned int	 bi_intfreq;		/* Processor speed, in Hz */
46 	unsigned int	 bi_busfreq;		/* PLB Bus speed, in Hz */
47 	unsigned int	 bi_pci_busfreq;	/* PCI Bus speed, in Hz */
48 	unsigned int	 bi_opbfreq;		/* OPB Bus speed, in Hz */
49 	int		 bi_iic_fast[1];	/* Use fast i2c mode */
50 } bd_t;
51 
52 /* Some 4xx parts use a different timebase frequency from the internal clock.
53 */
54 #define bi_tbfreq bi_intfreq
55 
56 
57 /* Memory map for the IBM "Walnut" 405GP evaluation board.
58  * Generic 4xx plus RTC.
59  */
60 
61 extern void *walnut_rtc_base;
62 #define WALNUT_RTC_PADDR	((uint)0xf0000000)
63 #define WALNUT_RTC_VADDR	WALNUT_RTC_PADDR
64 #define WALNUT_RTC_SIZE		((uint)8*1024)
65 
66 /* ps2 keyboard and mouse */
67 #define KEYBOARD_IRQ		25
68 #define AUX_IRQ			26
69 
70 #ifdef CONFIG_PPC405GP_INTERNAL_CLOCK
71 #define BASE_BAUD		201600
72 #else
73 #define BASE_BAUD		691200
74 #endif
75 
76 #define WALNUT_PS2_BASE		0xF0100000
77 #define WALNUT_FPGA_BASE	0xF0300000
78 
79 
80 extern void *kb_cs;
81 extern void *kb_data;
82 #define kbd_read_input()	readb(kb_data)
83 #define kbd_read_status()	readb(kb_cs)
84 #define kbd_write_output(val)	writeb(val, kb_data)
85 #define kbd_write_command(val)	writeb(val, kb_cs)
86 
87 #define PPC4xx_MACHINE_NAME	"IBM Walnut"
88 
89 #endif /* !__ASSEMBLY__ */
90 #endif /* __ASM_WALNUT_H__ */
91 #endif /* __KERNEL__ */
92