coreboot-v3/mainboard/artecgroup/dbe61/stage1.c
<<
>>
Prefs
   1/*
   2 * This file is part of the coreboot project.
   3 *
   4 * Copyright (C) 2007 Advanced Micro Devices, Inc.
   5 *
   6 * This program is free software; you can redistribute it and/or modify
   7 * it under the terms of the GNU General Public License as published by
   8 * the Free Software Foundation; either version 2 of the License, or
   9 * (at your option) any later version.
  10 *
  11 * This program is distributed in the hope that it will be useful,
  12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14 * GNU General Public License for more details.
  15 *
  16 * You should have received a copy of the GNU General Public License
  17 * along with this program; if not, write to the Free Software
  18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  19 */
  20
  21#include <types.h>
  22#include <lib.h>
  23#include <console.h>
  24#include <device/device.h>
  25#include <device/pci.h>
  26#include <string.h>
  27#include <msr.h>
  28#include <io.h>
  29#include <amd_geodelx.h>
  30#include <southbridge/amd/cs5536/cs5536.h>
  31#include <northbridge/amd/geodelx/raminit.h>
  32#include <arch/x86/msr.h>
  33
  34static const struct msrinit dbe61_msr[] = {
  35        {.msrnum = 0x10000020, {.lo = 0x00fff80, .hi = 0x20000000}},
  36        {.msrnum = 0x10000021, {.lo = 0x80fffe0, .hi = 0x20000000}},
  37        {.msrnum = 0x40000020, {.lo = 0x00fff80, .hi = 0x20000000}},
  38        {.msrnum = 0x40000021, {.lo = 0x80fffe0, .hi = 0x20000000}},
  39};
  40
  41static void dbe61_msr_init(void)
  42{
  43        int i;
  44        for (i = 0; i < ARRAY_SIZE(dbe61_msr); i++)
  45                wrmsr(dbe61_msr[i].msrnum, dbe61_msr[i].msr);
  46}
  47
  48void hardware_stage1(void)
  49{
  50        post_code(POST_START_OF_MAIN);
  51
  52        dbe61_msr_init();
  53
  54        cs5536_stage1();
  55
  56        /*
  57         * NOTE: Must do this AFTER the early_setup! It is counting on some
  58         * early MSR setup for the CS5536.
  59         */
  60        cs5536_setup_onchipuart(2);
  61
  62        /* Set up 4MB mode for Artec LPC Dongle (this should be a no-op when not booting from the dongle) */
  63        outb(0xf4,0x88);
  64}
  65
  66void mainboard_pre_payload(void)
  67{
  68        geode_pre_payload();
  69        banner(BIOS_DEBUG, "mainboard_pre_payload: done");
  70}
  71
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.