wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2002 |
| 3 | * Hyperion Entertainment, ThomasF@hyperion-entertainment.com |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 4 | * (C) Copyright 2006 |
wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 5 | * 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 Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 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> |
Ben Warren | 164846e | 2008-08-31 10:15:26 -0700 | [diff] [blame] | 29 | #include <netdev.h> |
wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 30 | #include "articiaS.h" |
| 31 | #include "memio.h" |
| 32 | #include "via686.h" |
| 33 | |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 34 | __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 Jin | 5618332 | 2007-07-13 12:14:59 +0800 | [diff] [blame] | 45 | |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 46 | "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 Jin | 5618332 | 2007-07-13 12:14:59 +0800 | [diff] [blame] | 57 | |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 58 | " bdnz idle \n " |
Jason Jin | 5618332 | 2007-07-13 12:14:59 +0800 | [diff] [blame] | 59 | |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 60 | " li r3, 0 \n " |
| 61 | " blr \n " |
Jason Jin | 5618332 | 2007-07-13 12:14:59 +0800 | [diff] [blame] | 62 | |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 63 | "done: \n " |
| 64 | " li r3, 1 \n " |
| 65 | " blr \n " |
Jason Jin | 5618332 | 2007-07-13 12:14:59 +0800 | [diff] [blame] | 66 | |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 67 | ".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 Jin | 5618332 | 2007-07-13 12:14:59 +0800 | [diff] [blame] | 76 | ); |
wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 77 | |
| 78 | |
| 79 | int checkboard (void) |
| 80 | { |
wdenk | 7c7a23b | 2002-12-07 00:20:59 +0000 | [diff] [blame] | 81 | printf ("Board: AmigaOneG3SE\n"); |
| 82 | return 0; |
wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 83 | } |
| 84 | |
Becky Bruce | 9973e3c | 2008-06-09 16:03:40 -0500 | [diff] [blame] | 85 | phys_size_t initdram (int board_type) |
wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 86 | { |
| 87 | return articiaS_ram_init (); |
| 88 | } |
| 89 | |
| 90 | |
wdenk | 7c7a23b | 2002-12-07 00:20:59 +0000 | [diff] [blame] | 91 | void after_reloc (ulong dest_addr, gd_t *gd) |
wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 92 | { |
wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 93 | board_init_r (gd, dest_addr); |
| 94 | } |
| 95 | |
| 96 | |
| 97 | int 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 | |
stroese | ad10dd9 | 2003-02-14 11:21:23 +0000 | [diff] [blame] | 109 | void pci_init_board (void) |
wdenk | c7de829 | 2002-11-19 11:04:11 +0000 | [diff] [blame] | 110 | { |
| 111 | #ifndef CONFIG_RAMBOOT |
| 112 | articiaS_pci_init (); |
| 113 | #endif |
| 114 | } |
Ben Warren | 164846e | 2008-08-31 10:15:26 -0700 | [diff] [blame] | 115 | |
| 116 | int board_eth_init(bd_t *bis) |
| 117 | { |
| 118 | #if defined(CONFIG_3COM) |
| 119 | eth_3com_initialize(bis); |
| 120 | #endif |
| 121 | return 0; |
| 122 | } |