uboot/board/MAI/AmigaOneG3SE/AmigaOneG3SE.c
<<
>>
Prefs
   1/*
   2 * (C) Copyright 2002
   3 * Hyperion Entertainment, ThomasF@hyperion-entertainment.com
   4 * (C) Copyright 2006
   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
  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 <netdev.h>
  30#include "articiaS.h"
  31#include "memio.h"
  32#include "via686.h"
  33
  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 "
  45
  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 "
  57
  58        "       bdnz    idle                            \n "
  59
  60        "       li      r3, 0                           \n "
  61        "       blr                                     \n "
  62
  63        "done:                                          \n "
  64        "       li      r3, 1                           \n "
  65        "       blr                                     \n "
  66
  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 "
  76);
  77
  78
  79int checkboard (void)
  80{
  81        printf ("Board: AmigaOneG3SE\n");
  82        return 0;
  83}
  84
  85phys_size_t initdram (int board_type)
  86{
  87        return articiaS_ram_init ();
  88}
  89
  90
  91void after_reloc (ulong dest_addr, gd_t *gd)
  92{
  93        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
 109void pci_init_board (void)
 110{
 111#ifndef CONFIG_RAMBOOT
 112        articiaS_pci_init ();
 113#endif
 114}
 115
 116int board_eth_init(bd_t *bis)
 117{
 118#if defined(CONFIG_3COM)
 119        eth_3com_initialize(bis);
 120#endif
 121        return 0;
 122}
 123