blob: 0934e1b693aeb7fd0e16d60e04e5e8deace8a1d9 [file] [log] [blame]
wdenk452cfd62002-11-19 11:04:11 +00001/*
2 * (C) Copyright 2002
3 * Hyperion Entertainment, ThomasF@hyperion-entertainment.com
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 *
6 * See file CREDITS for list of people who contributed to this
7 * project.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 * MA 02111-1307 USA
23 */
24
25#include <common.h>
26#include <command.h>
27#include <pci.h>
28#include "articiaS.h"
29#include "memio.h"
30#include "via686.h"
31
32__asm(" .globl send_kb \n
wdenk57b2d802003-06-27 21:31:46 +000033 send_kb: \n
34 lis r9, 0xfe00 \n
35 \n
36 li r4, 0x10 # retries \n
37 mtctr r4 \n
38 \n
39 idle: \n
40 lbz r4, 0x64(r9) \n
41 andi. r4, r4, 0x02 \n
42 bne idle \n
43 \n
44 ready: \n
45 stb r3, 0x60(r9) \n
46 \n
47 check: \n
48 lbz r4, 0x64(r9) \n
49 andi. r4, r4, 0x01 \n
50 beq check \n
51 \n
52 lbz r4, 0x60(r9) \n
53 cmpwi r4, 0xfa \n
54 beq done \n
55 \n
56 bdnz idle \n
57 \n
58 li r3, 0 \n
59 blr \n
60 \n
61 done: \n
62 li r3, 1 \n
63 blr \n
64 \n
65 .globl test_kb \n
66 test_kb: \n
67 mflr r10 \n
68 li r3, 0xed \n
69 bl send_kb \n
70 li r3, 0x01 \n
71 bl send_kb \n
72 mtlr r10 \n
73 blr \n
wdenk452cfd62002-11-19 11:04:11 +000074");
75
76
77int checkboard (void)
78{
wdenkbb444c92002-12-07 00:20:59 +000079 printf ("Board: AmigaOneG3SE\n");
80 return 0;
wdenk452cfd62002-11-19 11:04:11 +000081}
82
83long initdram (int board_type)
84{
85 return articiaS_ram_init ();
86}
87
88
wdenkbb444c92002-12-07 00:20:59 +000089void after_reloc (ulong dest_addr, gd_t *gd)
wdenk452cfd62002-11-19 11:04:11 +000090{
wdenkbb444c92002-12-07 00:20:59 +000091/* HJF: DECLARE_GLOBAL_DATA_PTR; */
wdenk452cfd62002-11-19 11:04:11 +000092
93 board_init_r (gd, dest_addr);
94}
95
96
97int misc_init_r (void)
98{
99 extern pci_dev_t video_dev;
100 extern void drv_video_init (void);
101
102 if (video_dev != ~0)
103 drv_video_init ();
104
105 return (0);
106}
107
108
stroesef5dd4102003-02-14 11:21:23 +0000109void pci_init_board (void)
wdenk452cfd62002-11-19 11:04:11 +0000110{
111#ifndef CONFIG_RAMBOOT
112 articiaS_pci_init ();
113#endif
114}