blob: 0cf5388a4336504aa500820a66082d0e481857b6 [file] [log] [blame]
wdenkc7de8292002-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
33 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
74");
75
76
77int checkboard (void)
78{
79 printf ("AmigaOneG3SE\n");
80
81 return 1;
82}
83
84long initdram (int board_type)
85{
86 return articiaS_ram_init ();
87}
88
89
90
91void after_reloc (ulong dest_addr)
92{
93 DECLARE_GLOBAL_DATA_PTR;
94
95 board_init_r (gd, dest_addr);
96}
97
98
99int misc_init_r (void)
100{
101 extern pci_dev_t video_dev;
102 extern void drv_video_init (void);
103
104 if (video_dev != ~0)
105 drv_video_init ();
106
107 return (0);
108}
109
110
111void pci_init (void)
112{
113#ifndef CONFIG_RAMBOOT
114 articiaS_pci_init ();
115#endif
116}