blob: 9d5c24e2fc3e718904cafe5c91f16b03d58ea9e0 [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{
wdenk7c7a23b2002-12-07 00:20:59 +000079 printf ("Board: AmigaOneG3SE\n");
80 return 0;
wdenkc7de8292002-11-19 11:04:11 +000081}
82
83long initdram (int board_type)
84{
85 return articiaS_ram_init ();
86}
87
88
89
wdenk7c7a23b2002-12-07 00:20:59 +000090void after_reloc (ulong dest_addr, gd_t *gd)
wdenkc7de8292002-11-19 11:04:11 +000091{
wdenk7c7a23b2002-12-07 00:20:59 +000092/* HJF: DECLARE_GLOBAL_DATA_PTR; */
wdenkc7de8292002-11-19 11:04:11 +000093
94 board_init_r (gd, dest_addr);
95}
96
97
98int misc_init_r (void)
99{
100 extern pci_dev_t video_dev;
101 extern void drv_video_init (void);
102
103 if (video_dev != ~0)
104 drv_video_init ();
105
106 return (0);
107}
108
109
110void pci_init (void)
111{
112#ifndef CONFIG_RAMBOOT
113 articiaS_pci_init ();
114#endif
115}