blob: e118563fc42c37ec2e4692ff8f7672197a56bf2c [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>
29#include "articiaS.h"
30#include "memio.h"
31#include "via686.h"
32
Wolfgang Denk53677ef2008-05-20 16:00:29 +020033__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 "
Jason Jin56183322007-07-13 12:14:59 +080044
Wolfgang Denk53677ef2008-05-20 16:00:29 +020045 "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 "
Jason Jin56183322007-07-13 12:14:59 +080056
Wolfgang Denk53677ef2008-05-20 16:00:29 +020057 " bdnz idle \n "
Jason Jin56183322007-07-13 12:14:59 +080058
Wolfgang Denk53677ef2008-05-20 16:00:29 +020059 " li r3, 0 \n "
60 " blr \n "
Jason Jin56183322007-07-13 12:14:59 +080061
Wolfgang Denk53677ef2008-05-20 16:00:29 +020062 "done: \n "
63 " li r3, 1 \n "
64 " blr \n "
Jason Jin56183322007-07-13 12:14:59 +080065
Wolfgang Denk53677ef2008-05-20 16:00:29 +020066 ".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 \n "
Jason Jin56183322007-07-13 12:14:59 +080075);
wdenkc7de8292002-11-19 11:04:11 +000076
77
78int checkboard (void)
79{
wdenk7c7a23b2002-12-07 00:20:59 +000080 printf ("Board: AmigaOneG3SE\n");
81 return 0;
wdenkc7de8292002-11-19 11:04:11 +000082}
83
Becky Bruce9973e3c2008-06-09 16:03:40 -050084phys_size_t initdram (int board_type)
wdenkc7de8292002-11-19 11:04:11 +000085{
86 return articiaS_ram_init ();
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{
wdenkc7de8292002-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
stroesead10dd92003-02-14 11:21:23 +0000108void pci_init_board (void)
wdenkc7de8292002-11-19 11:04:11 +0000109{
110#ifndef CONFIG_RAMBOOT
111 articiaS_pci_init ();
112#endif
113}