get the tree compiling. it does nothing yet.

These are all trivial changes.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>


git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@50 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Stefan Reinauer 2006-12-03 20:14:21 +00:00
parent c85c6f2514
commit 8e23c524b1
5 changed files with 176 additions and 22 deletions

View file

@ -261,7 +261,7 @@ LINUXBIOSINCLUDE := -Iinclude \
-I$(srctree)/include \
-I$(srctree)/include/cpu/generic/$(ARCH)/ \
-I$(srctree)/include/cpu/generic/x86/ \
-include include/linuxbios/autoconf.h
-include $(srctree)/include/linuxbios/autoconf.h
CPPFLAGS := $(LINUXBIOSINCLUDE)
@ -355,7 +355,8 @@ ifeq ($(config-targets),1)
# Read arch specific Makefile to set LBBUILD_DEFCONFIG as needed.
# LBBUILD_DEFCONFIG may point out an alternative default configuration
# used for 'make defconfig'
include $(srctree)/mainboard/$(MAINBOARD)/Makefile
# The ? makes the error go away if configuration has been done yet.
include $(srctree)/mainboard/$(MAINBOARD)/Makefil?
export LBBUILD_DEFCONFIG

View file

@ -0,0 +1,151 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _ARCH_IO_H
#define _ARCH_IO_H
#include <stdint.h>
/*
* This file contains the definitions for the x86 IO instructions
* inb/inw/inl/outb/outw/outl and the "string versions" of the same
* (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
* versions of the single-IO instructions (inb_p/inw_p/..).
*/
static inline void outb(uint8_t value, uint16_t port)
{
__asm__ __volatile__ ("outb %b0, %w1" : : "a" (value), "Nd" (port));
}
static inline void outw(uint16_t value, uint16_t port)
{
__asm__ __volatile__ ("outw %w0, %w1" : : "a" (value), "Nd" (port));
}
static inline void outl(uint32_t value, uint16_t port)
{
__asm__ __volatile__ ("outl %0, %w1" : : "a" (value), "Nd" (port));
}
static inline uint8_t inb(uint16_t port)
{
uint8_t value;
__asm__ __volatile__ ("inb %w1, %b0" : "=a"(value) : "Nd" (port));
return value;
}
static inline uint16_t inw(uint16_t port)
{
uint16_t value;
__asm__ __volatile__ ("inw %w1, %w0" : "=a"(value) : "Nd" (port));
return value;
}
static inline uint32_t inl(uint16_t port)
{
uint32_t value;
__asm__ __volatile__ ("inl %w1, %0" : "=a"(value) : "Nd" (port));
return value;
}
static inline void outsb(uint16_t port, const void *addr, unsigned long count)
{
__asm__ __volatile__ (
"cld ; rep ; outsb "
: "=S" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
}
static inline void outsw(uint16_t port, const void *addr, unsigned long count)
{
__asm__ __volatile__ (
"cld ; rep ; outsw "
: "=S" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
}
static inline void outsl(uint16_t port, const void *addr, unsigned long count)
{
__asm__ __volatile__ (
"cld ; rep ; outsl "
: "=S" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
}
static inline void insb(uint16_t port, void *addr, unsigned long count)
{
__asm__ __volatile__ (
"cld ; rep ; insb "
: "=D" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
}
static inline void insw(uint16_t port, void *addr, unsigned long count)
{
__asm__ __volatile__ (
"cld ; rep ; insw "
: "=D" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
}
static inline void insl(uint16_t port, void *addr, unsigned long count)
{
__asm__ __volatile__ (
"cld ; rep ; insl "
: "=D" (addr), "=c" (count)
: "d"(port), "0"(addr), "1" (count)
);
}
static inline void writeb(uint8_t b, volatile void *addr)
{
*(volatile uint8_t *) addr = b;
}
static inline void writew(uint16_t b, volatile void *addr)
{
*(volatile uint16_t *) addr = b;
}
static inline void writel(uint32_t b, volatile void *addr)
{
*(volatile uint32_t *) addr = b;
}
static inline uint8_t readb(const volatile void *addr)
{
return *(volatile uint8_t *) addr;
}
static inline uint16_t readw(const volatile void *addr)
{
return *(volatile uint16_t *) addr;
}
static inline uint32_t readl(const volatile void *addr)
{
return *(volatile uint32_t *) addr;
}
#endif

View file

@ -9,6 +9,11 @@ core-$(UNCOMPRESSORS) += uncompressors
$(obj)/mainboard.o: $(obj)/dtc.h
$(obj)/dtc.h: $(src)/dts
dtc -O lb $(src)/dts >$(obj)/dtc.h
$(obj)/dtc.h: $(src)/dts $(obj)/dtc
$(obj)/dtc -O lb $(src)/dts >$(obj)/dtc.h
# this does not belong in this file.
$(obj)/dtc:
$(MAKE) -C $(srctree)/util/dtc/
cp $(srctree)/util/dtc/dtc $(obj)/

View file

@ -20,7 +20,7 @@
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <arch/types.h>
#include "dtc.h"
// #include "dtc.h"
struct chip_operations mainboard_emulation_qemu_i386_ops = {
.name = "QEMU Mainboard"

View file

@ -1,27 +1,24 @@
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#include <stdint.h>
#include <device/pci_def.h>
#include <device/pci_ids.h>
#include <arch/io.h>
#include <device/pnp_def.h>
#include <arch/romcc_io.h>
#include <arch/hlt.h>
#include "option_table.h"
/*
*/