mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
Blasting away the previous commit (r33) as it wasn't meant
to check in all this, just part of it. git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@34 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
da145f2f9e
commit
367e462351
10 changed files with 45 additions and 161 deletions
|
@ -17,7 +17,7 @@
|
||||||
#ifndef CONSOLE_CONSOLE_H_
|
#ifndef CONSOLE_CONSOLE_H_
|
||||||
#define CONSOLE_CONSOLE_H_
|
#define CONSOLE_CONSOLE_H_
|
||||||
|
|
||||||
#include <arch/types.h>
|
#include <stdint.h>
|
||||||
#include <console/loglevel.h>
|
#include <console/loglevel.h>
|
||||||
|
|
||||||
void console_init(void);
|
void console_init(void);
|
||||||
|
@ -25,7 +25,7 @@ void console_tx_byte(unsigned char byte);
|
||||||
void console_tx_flush(void);
|
void console_tx_flush(void);
|
||||||
unsigned char console_rx_byte(void);
|
unsigned char console_rx_byte(void);
|
||||||
int console_tst_byte(void);
|
int console_tst_byte(void);
|
||||||
void post_code(u8 value);
|
void post_code(uint8_t value);
|
||||||
void die(const char *msg);
|
void die(const char *msg);
|
||||||
|
|
||||||
struct console_driver {
|
struct console_driver {
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
/*
|
/* data types */
|
||||||
* Generic data types.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _ARCH_TYPES_H
|
|
||||||
#define _ARCH_TYPES_H
|
|
||||||
|
|
||||||
typedef unsigned long long u64;
|
typedef unsigned long long u64;
|
||||||
typedef unsigned int u32;
|
typedef unsigned int u32;
|
||||||
typedef unsigned short u16;
|
typedef unsigned short u16;
|
||||||
typedef unsigned char u8;
|
typedef unsigned char u8;
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#ifndef DEVICE_H
|
#ifndef DEVICE_H
|
||||||
#define DEVICE_H
|
#define DEVICE_H
|
||||||
|
|
||||||
#include <arch/types.h>
|
#include <stdint.h>
|
||||||
#include <device/resource.h>
|
#include <device/resource.h>
|
||||||
#include <device/path.h>
|
#include <device/path.h>
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ struct device {
|
||||||
unsigned int on_mainboard : 1;
|
unsigned int on_mainboard : 1;
|
||||||
unsigned long rom_address;
|
unsigned long rom_address;
|
||||||
|
|
||||||
u8 command;
|
uint8_t command;
|
||||||
|
|
||||||
/* Base registers for this device. I/O, MEM and Expansion ROM */
|
/* Base registers for this device. I/O, MEM and Expansion ROM */
|
||||||
struct resource resource[MAX_RESOURCES];
|
struct resource resource[MAX_RESOURCES];
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#ifndef PCI_H
|
#ifndef PCI_H
|
||||||
#define PCI_H
|
#define PCI_H
|
||||||
|
|
||||||
#include <arch/types.h>
|
|
||||||
#include <device/pci_def.h>
|
#include <device/pci_def.h>
|
||||||
#include <device/resource.h>
|
#include <device/resource.h>
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
|
@ -46,17 +45,12 @@ struct pci_operations {
|
||||||
|
|
||||||
/* Common pci bus operations */
|
/* Common pci bus operations */
|
||||||
struct pci_bus_operations {
|
struct pci_bus_operations {
|
||||||
u8 (*read8)(struct bus *pbus, unsigned char bus, int devfn, int where);
|
uint8_t (*read8) (struct bus *pbus, unsigned char bus, int devfn, int where);
|
||||||
u16 (*read16)(struct bus *pbus, unsigned char bus, int devfn,
|
uint16_t (*read16) (struct bus *pbus, unsigned char bus, int devfn, int where);
|
||||||
int where);
|
uint32_t (*read32) (struct bus *pbus, unsigned char bus, int devfn, int where);
|
||||||
u32 (*read32)(struct bus *pbus, unsigned char bus, int devfn,
|
void (*write8) (struct bus *pbus, unsigned char bus, int devfn, int where, uint8_t val);
|
||||||
int where);
|
void (*write16) (struct bus *pbus, unsigned char bus, int devfn, int where, uint16_t val);
|
||||||
void (*write8)(struct bus *pbus, unsigned char bus, int devfn,
|
void (*write32) (struct bus *pbus, unsigned char bus, int devfn, int where, uint32_t val);
|
||||||
int where, u8 val);
|
|
||||||
void (*write16)(struct bus *pbus, unsigned char bus, int devfn,
|
|
||||||
int where, u16 val);
|
|
||||||
void (*write32)(struct bus *pbus, unsigned char bus, int devfn,
|
|
||||||
int where, u32 val);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pci_driver {
|
struct pci_driver {
|
||||||
|
@ -87,9 +81,9 @@ unsigned int do_pci_scan_bridge(device_t bus, unsigned int max,
|
||||||
unsigned min_devfn, unsigned max_devfn, unsigned int max));
|
unsigned min_devfn, unsigned max_devfn, unsigned int max));
|
||||||
unsigned int pci_scan_bridge(device_t bus, unsigned int max);
|
unsigned int pci_scan_bridge(device_t bus, unsigned int max);
|
||||||
unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned int max);
|
unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned int max);
|
||||||
u8 pci_moving_config8(struct device *dev, unsigned reg);
|
uint8_t pci_moving_config8(struct device *dev, unsigned reg);
|
||||||
u16 pci_moving_config16(struct device *dev, unsigned reg);
|
uint16_t pci_moving_config16(struct device *dev, unsigned reg);
|
||||||
u32 pci_moving_config32(struct device *dev, unsigned reg);
|
uint32_t pci_moving_config32(struct device *dev, unsigned reg);
|
||||||
unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last);
|
unsigned pci_find_next_capability(device_t dev, unsigned cap, unsigned last);
|
||||||
unsigned pci_find_capability(device_t dev, unsigned cap);
|
unsigned pci_find_capability(device_t dev, unsigned cap);
|
||||||
struct resource *pci_get_resource(struct device *dev, unsigned long index);
|
struct resource *pci_get_resource(struct device *dev, unsigned long index);
|
||||||
|
|
|
@ -17,14 +17,14 @@
|
||||||
#ifndef PCI_OPS_H
|
#ifndef PCI_OPS_H
|
||||||
#define PCI_OPS_H
|
#define PCI_OPS_H
|
||||||
|
|
||||||
#include <arch/types.h>
|
#include <stdint.h>
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
|
|
||||||
u8 pci_read_config8(device_t dev, unsigned where);
|
uint8_t pci_read_config8(device_t dev, unsigned where);
|
||||||
u16 pci_read_config16(device_t dev, unsigned where);
|
uint16_t pci_read_config16(device_t dev, unsigned where);
|
||||||
u32 pci_read_config32(device_t dev, unsigned where);
|
uint32_t pci_read_config32(device_t dev, unsigned where);
|
||||||
void pci_write_config8(device_t dev, unsigned where, u8 val);
|
void pci_write_config8(device_t dev, unsigned where, uint8_t val);
|
||||||
void pci_write_config16(device_t dev, unsigned where, u16 val);
|
void pci_write_config16(device_t dev, unsigned where, uint16_t val);
|
||||||
void pci_write_config32(device_t dev, unsigned where, u32 val);
|
void pci_write_config32(device_t dev, unsigned where, uint32_t val);
|
||||||
|
|
||||||
#endif /* PCI_OPS_H */
|
#endif /* PCI_OPS_H */
|
||||||
|
|
|
@ -16,38 +16,37 @@
|
||||||
*/
|
*/
|
||||||
#ifndef PCI_ROM_H
|
#ifndef PCI_ROM_H
|
||||||
#define PCI_ROM_H
|
#define PCI_ROM_H
|
||||||
#include <arch/types.h>
|
|
||||||
#include <arch/byteorder.h>
|
#include <arch/byteorder.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#define PCI_ROM_HDR 0xAA55
|
#define PCI_ROM_HDR 0xAA55
|
||||||
#define PCI_DATA_HDR (u32) ( ('R' << 24) | ('I' << 16) | ('C' << 8) | 'P' )
|
#define PCI_DATA_HDR (uint32_t) ( ('R' << 24) | ('I' << 16) | ('C' << 8) | 'P' )
|
||||||
|
|
||||||
#define PCI_RAM_IMAGE_START 0xD0000
|
#define PCI_RAM_IMAGE_START 0xD0000
|
||||||
#define PCI_VGA_RAM_IMAGE_START 0xC0000
|
#define PCI_VGA_RAM_IMAGE_START 0xC0000
|
||||||
|
|
||||||
struct rom_header {
|
struct rom_header {
|
||||||
u16 signature;
|
uint16_t signature;
|
||||||
u8 size;
|
uint8_t size;
|
||||||
u8 init[3];
|
uint8_t init[3];
|
||||||
u8 reserved[0x12];
|
uint8_t reserved[0x12];
|
||||||
u16 data;
|
uint16_t data;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pci_data {
|
struct pci_data {
|
||||||
u32 signature;
|
uint32_t signature;
|
||||||
u16 vendor;
|
uint16_t vendor;
|
||||||
u16 device;
|
uint16_t device;
|
||||||
u16 reserved_1;
|
uint16_t reserved_1;
|
||||||
u16 dlen;
|
uint16_t dlen;
|
||||||
u8 drevision;
|
uint8_t drevision;
|
||||||
u8 class_lo;
|
uint8_t class_lo;
|
||||||
u16 class_hi;
|
uint16_t class_hi;
|
||||||
u16 ilen;
|
uint16_t ilen;
|
||||||
u16 irevision;
|
uint16_t irevision;
|
||||||
u8 type;
|
uint8_t type;
|
||||||
u8 indicator;
|
uint8_t indicator;
|
||||||
u16 reserved_2;
|
uint16_t reserved_2;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct rom_header * pci_rom_probe(struct device *dev);
|
extern struct rom_header * pci_rom_probe(struct device *dev);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#ifndef RESOURCE_H
|
#ifndef RESOURCE_H
|
||||||
#define RESOURCE_H
|
#define RESOURCE_H
|
||||||
|
|
||||||
#include <arch/types.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
|
#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
#define IORESOURCE_MEM_EXPANSIONROM (1<<6)
|
#define IORESOURCE_MEM_EXPANSIONROM (1<<6)
|
||||||
|
|
||||||
|
|
||||||
typedef u64 resource_t;
|
typedef uint64_t resource_t;
|
||||||
struct resource {
|
struct resource {
|
||||||
resource_t base; /* Base address of the resource */
|
resource_t base; /* Base address of the resource */
|
||||||
resource_t size; /* Size of the resource */
|
resource_t size; /* Size of the resource */
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
#include <device/pci.h>
|
#include <device/pci.h>
|
||||||
#include <device/pci_ids.h>
|
#include <device/pci_ids.h>
|
||||||
#include <device/pci_ops.h>
|
#include <device/pci_ops.h>
|
||||||
#include <arch/types.h>
|
#include <arch/stdint.h>
|
||||||
#include "dtc.h"
|
#include "dtc.h"
|
||||||
|
|
||||||
struct chip_operations mainboard_emulation_qemu_i386_ops = {
|
struct chip_operations mainboard_emulation_qemu_i386_ops = {
|
||||||
.name = "qemu mainboard "
|
"qemu mainboard "
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
|
||||||
|
|
||||||
define rule_cc_o_c
|
define rule_cc_o_c
|
||||||
$(call echo-cmd,checksrc) $(cmd_checksrc) \
|
$(call echo-cmd,checksrc) $(cmd_checksrc) \
|
||||||
$(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
|
$(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ \
|
||||||
scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > $(@D)/.$(@F).tmp; \
|
scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > $(@D)/.$(@F).tmp; \
|
||||||
rm -f $(depfile); \
|
rm -f $(depfile); \
|
||||||
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
|
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
|
||||||
|
|
|
@ -1,102 +0,0 @@
|
||||||
# ==========================================================================
|
|
||||||
# Cleaning up
|
|
||||||
# ==========================================================================
|
|
||||||
|
|
||||||
src := $(obj)
|
|
||||||
|
|
||||||
PHONY := __clean
|
|
||||||
__clean:
|
|
||||||
|
|
||||||
# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
|
|
||||||
# Usage:
|
|
||||||
# $(Q)$(MAKE) $(clean)=dir
|
|
||||||
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
|
|
||||||
|
|
||||||
# The filename Kbuild has precedence over Makefile
|
|
||||||
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
|
|
||||||
include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
|
|
||||||
|
|
||||||
# Figure out what we need to build from the various variables
|
|
||||||
# ==========================================================================
|
|
||||||
|
|
||||||
__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
|
|
||||||
subdir-y += $(__subdir-y)
|
|
||||||
__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
|
|
||||||
subdir-m += $(__subdir-m)
|
|
||||||
__subdir-n := $(patsubst %/,%,$(filter %/, $(obj-n)))
|
|
||||||
subdir-n += $(__subdir-n)
|
|
||||||
__subdir- := $(patsubst %/,%,$(filter %/, $(obj-)))
|
|
||||||
subdir- += $(__subdir-)
|
|
||||||
|
|
||||||
# Subdirectories we need to descend into
|
|
||||||
|
|
||||||
subdir-ym := $(sort $(subdir-y) $(subdir-m))
|
|
||||||
subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-))
|
|
||||||
|
|
||||||
# Add subdir path
|
|
||||||
|
|
||||||
subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
|
|
||||||
|
|
||||||
# build a list of files to remove, usually releative to the current
|
|
||||||
# directory
|
|
||||||
|
|
||||||
__clean-files := $(extra-y) $(EXTRA_TARGETS) $(always) \
|
|
||||||
$(targets) $(clean-files) \
|
|
||||||
$(host-progs) \
|
|
||||||
$(hostprogs-y) $(hostprogs-m) $(hostprogs-)
|
|
||||||
|
|
||||||
# as clean-files is given relative to the current directory, this adds
|
|
||||||
# a $(obj) prefix, except for absolute paths
|
|
||||||
|
|
||||||
__clean-files := $(wildcard \
|
|
||||||
$(addprefix $(obj)/, $(filter-out /%, $(__clean-files))) \
|
|
||||||
$(filter /%, $(__clean-files)))
|
|
||||||
|
|
||||||
# as clean-dirs is given relative to the current directory, this adds
|
|
||||||
# a $(obj) prefix, except for absolute paths
|
|
||||||
|
|
||||||
__clean-dirs := $(wildcard \
|
|
||||||
$(addprefix $(obj)/, $(filter-out /%, $(clean-dirs))) \
|
|
||||||
$(filter /%, $(clean-dirs)))
|
|
||||||
|
|
||||||
# ==========================================================================
|
|
||||||
|
|
||||||
quiet_cmd_clean = CLEAN $(obj)
|
|
||||||
cmd_clean = rm -f $(__clean-files)
|
|
||||||
quiet_cmd_cleandir = CLEAN $(__clean-dirs)
|
|
||||||
cmd_cleandir = rm -rf $(__clean-dirs)
|
|
||||||
|
|
||||||
|
|
||||||
__clean: $(subdir-ymn)
|
|
||||||
ifneq ($(strip $(__clean-files)),)
|
|
||||||
+$(call cmd,clean)
|
|
||||||
endif
|
|
||||||
ifneq ($(strip $(__clean-dirs)),)
|
|
||||||
+$(call cmd,cleandir)
|
|
||||||
endif
|
|
||||||
ifneq ($(strip $(clean-rule)),)
|
|
||||||
+$(clean-rule)
|
|
||||||
endif
|
|
||||||
@:
|
|
||||||
|
|
||||||
|
|
||||||
# ===========================================================================
|
|
||||||
# Generic stuff
|
|
||||||
# ===========================================================================
|
|
||||||
|
|
||||||
# Descending
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
PHONY += $(subdir-ymn)
|
|
||||||
$(subdir-ymn):
|
|
||||||
$(Q)$(MAKE) $(clean)=$@
|
|
||||||
|
|
||||||
# If quiet is set, only print short version of command
|
|
||||||
|
|
||||||
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
|
|
||||||
|
|
||||||
|
|
||||||
# Declare the contents of the .PHONY variable as phony. We keep that
|
|
||||||
# information in a variable se we can use it in if_changed and friends.
|
|
||||||
|
|
||||||
.PHONY: $(PHONY)
|
|
Loading…
Add table
Reference in a new issue