blob: 4d44001ffa412209d9b43466fad6d2f87afe2528 [file] [log] [blame]
wdenkc7de8292002-11-19 11:04:11 +00001/*
2 * (C) Copyright 2002
3 * Hyperion Entertainment, ThomasF@hyperion-entertainment.com
Wolfgang Denkd87080b2006-03-31 18:32:53 +02004 * (C) Copyright 2006
wdenkc7de8292002-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
Wolfgang Denk53677ef2008-05-20 16:00:29 +020017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wdenkc7de8292002-11-19 11:04:11 +000018 * 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>
Ben Warren164846e2008-08-31 10:15:26 -070029#include <netdev.h>
wdenkc7de8292002-11-19 11:04:11 +000030#include "articiaS.h"
31#include "memio.h"
32#include "via686.h"
33
Wolfgang Denk53677ef2008-05-20 16:00:29 +020034__asm__(" .globl send_kb \n "
35 "send_kb: \n "
36 " lis r9, 0xfe00 \n "
37 " \n "
38 " li r4, 0x10 # retries \n "
39 " mtctr r4 \n "
40 " \n "
41 "idle: \n "
42 " lbz r4, 0x64(r9) \n "
43 " andi. r4, r4, 0x02 \n "
44 " bne idle \n "
Jason Jin56183322007-07-13 12:14:59 +080045
Wolfgang Denk53677ef2008-05-20 16:00:29 +020046 "ready: \n "
47 " stb r3, 0x60(r9) \n "
48 " \n "
49 "check: \n "
50 " lbz r4, 0x64(r9) \n "
51 " andi. r4, r4, 0x01 \n "
52 " beq check \n "
53 " \n "
54 " lbz r4, 0x60(r9) \n "
55 " cmpwi r4, 0xfa \n "
56 " beq done \n "
Jason Jin56183322007-07-13 12:14:59 +080057
Wolfgang Denk53677ef2008-05-20 16:00:29 +020058 " bdnz idle \n "
Jason Jin56183322007-07-13 12:14:59 +080059
Wolfgang Denk53677ef2008-05-20 16:00:29 +020060 " li r3, 0 \n "
61 " blr \n "
Jason Jin56183322007-07-13 12:14:59 +080062
Wolfgang Denk53677ef2008-05-20 16:00:29 +020063 "done: \n "
64 " li r3, 1 \n "
65 " blr \n "
Jason Jin56183322007-07-13 12:14:59 +080066
Wolfgang Denk53677ef2008-05-20 16:00:29 +020067 ".globl test_kb \n "
68 "test_kb: \n "
69 " mflr r10 \n "
70 " li r3, 0xed \n "
71 " bl send_kb \n "
72 " li r3, 0x01 \n "
73 " bl send_kb \n "
74 " mtlr r10 \n "
75 " blr \n "
Jason Jin56183322007-07-13 12:14:59 +080076);
wdenkc7de8292002-11-19 11:04:11 +000077
78
79int checkboard (void)
80{
wdenk7c7a23b2002-12-07 00:20:59 +000081 printf ("Board: AmigaOneG3SE\n");
82 return 0;
wdenkc7de8292002-11-19 11:04:11 +000083}
84
Becky Bruce9973e3c2008-06-09 16:03:40 -050085phys_size_t initdram (int board_type)
wdenkc7de8292002-11-19 11:04:11 +000086{
87 return articiaS_ram_init ();
88}
89
90
wdenk7c7a23b2002-12-07 00:20:59 +000091void after_reloc (ulong dest_addr, gd_t *gd)
wdenkc7de8292002-11-19 11:04:11 +000092{
wdenkc7de8292002-11-19 11:04:11 +000093 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
stroesead10dd92003-02-14 11:21:23 +0000109void pci_init_board (void)
wdenkc7de8292002-11-19 11:04:11 +0000110{
111#ifndef CONFIG_RAMBOOT
112 articiaS_pci_init ();
113#endif
114}
Ben Warren164846e2008-08-31 10:15:26 -0700115
116int board_eth_init(bd_t *bis)
117{
118#if defined(CONFIG_3COM)
119 eth_3com_initialize(bis);
120#endif
121 return 0;
122}