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