Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10222
-gerrit
commit 09178659ad30046d21d2b5fbf6a50c8f5349605b
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri May 15 16:56:27 2015 -0500
Revert "pistashio: bump up romstage size"
This reverts commit 701211a6e57a17ea861b4ad682dca7416fc9050e.
Change-Id: Ib3e573548bff5c17ab30cfab3d833a2065d689c9
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/soc/imgtec/pistachio/include/soc/memlayout.ld | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/soc/imgtec/pistachio/include/soc/memlayout.ld b/src/soc/imgtec/pistachio/include/soc/memlayout.ld
index b36d47e..326a26b 100644
--- a/src/soc/imgtec/pistachio/include/soc/memlayout.ld
+++ b/src/soc/imgtec/pistachio/include/soc/memlayout.ld
@@ -38,8 +38,8 @@ SECTIONS
* and then through the identity mapping in ROM stage.
*/
SRAM_START(0x1a000000)
- ROMSTAGE(0x1a005000, 40K)
- PRERAM_CBFS_CACHE(0x1a00f000, 68K)
+ ROMSTAGE(0x1a005000, 36K)
+ PRERAM_CBFS_CACHE(0x1a00e000, 72K)
SRAM_END(0x1a020000)
/* Bootblock executes out of KSEG0 and sets up the identity mapping.
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10261
-gerrit
commit e832e7d0abf5634eb3b674a4aaa1990c1fca34f9
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Tue May 19 16:25:20 2015 -0500
prog_loading: add region_device representing memory
One can remove the struct buffer_area and use the region_device
embedded in the struct prog to represent the in-memory loaded
program. Do this by introducing a addrspace_32bit mem_region_device
that can have region_device operations performed on it. The
addrspace_32bit name was chosen to make it explicit that 32-bits
of address space is supported at the max.
Change-Id: Ifffa0ef301141de940e54581b5a7b6cd81311ead
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/include/program_loading.h | 34 ++++++++++++++++++----------------
src/lib/prog_loaders.c | 3 +++
2 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index eb99350..91fa2c5 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -34,11 +34,6 @@ enum {
* set on the last segment loaded. */
void arch_segment_loaded(uintptr_t start, size_t size, int flags);
-struct buffer_area {
- void *data;
- size_t size;
-};
-
enum prog_type {
PROG_VERSTAGE,
PROG_ROMSTAGE,
@@ -52,28 +47,27 @@ enum prog_type {
struct prog {
enum prog_type type;
const char *name;
- /* Source of program content to load. */
+ /* Source of program content to load. After loading program it
+ * represents the memory region of the stages and payload. For
+ * achitectures that use a bounce buffer then it would represent
+ * the bounce buffer. */
struct region_device rdev;
- /* The area can mean different things depending on what type the
- * program is. A stage after being loaded reflects the memory occupied
- * by the program, Since payloads are multi-segment one can't express
- * the memory layout with one range. Instead this field is updated
- * to reflect the bounce buffer used. */
- struct buffer_area area;
/* Entry to program with optional argument. It's up to the architecture
* to decide if argument is passed. */
void (*entry)(void *);
void *arg;
};
+/* Only valid for loaded programs. */
static inline size_t prog_size(const struct prog *prog)
{
- return prog->area.size;
+ return region_device_sz(&prog->rdev);
}
+/* Only valid for loaded programs. */
static inline void *prog_start(const struct prog *prog)
{
- return prog->area.data;
+ return rdev_mmap_full(&prog->rdev);
}
static inline void *prog_entry(const struct prog *prog)
@@ -86,10 +80,18 @@ static inline void *prog_entry_arg(const struct prog *prog)
return prog->arg;
}
+/* region_device representing the 32-bit flat address space. */
+extern const struct mem_region_device addrspace_32bit;
+
+static inline void prog_memory_init(struct prog *prog, uintptr_t ptr,
+ size_t size)
+{
+ rdev_chain(&prog->rdev, &addrspace_32bit.rdev, ptr, size);
+}
+
static inline void prog_set_area(struct prog *prog, void *start, size_t size)
{
- prog->area.data = start;
- prog->area.size = size;
+ prog_memory_init(prog, (uintptr_t)start, size);
}
static inline void prog_set_entry(struct prog *prog, void *e, void *arg)
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
index 881cd99..7799994 100644
--- a/src/lib/prog_loaders.c
+++ b/src/lib/prog_loaders.c
@@ -35,6 +35,9 @@
#include <symbols.h>
#include <timestamp.h>
+/* Only can represent up to 1 byte less than size_t. */
+const struct mem_region_device addrspace_32bit = MEM_REGION_DEV_INIT(0, ~0UL);
+
#define DEFAULT_CBFS_LOADER_PRESENT \
(!ENV_VERSTAGE || (ENV_VERSTAGE && !CONFIG_RETURN_FROM_VERSTAGE))
Alexander Couzens (lynxis(a)fe80.eu) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9708
-gerrit
commit c1c3704083951f515258e166ab11b298a82bbcdd
Author: Alexander Couzens <lynxis(a)fe80.eu>
Date: Thu Apr 16 02:03:26 2015 +0200
acpi/sata: add generic sata ssdt port generator
generate_sata_ssdt_ports() generates ports based on sata enable map
Change-Id: Ie68e19c93f093d6c61634c4adfde484b88f28a77
Signed-off-by: Alexander Couzens <lynxis(a)fe80.eu>
---
Makefile.inc | 2 +-
src/Kconfig | 2 ++
src/acpi/Kconfig | 6 +++++
src/acpi/Makefile.inc | 1 +
src/acpi/sata.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++
src/acpi/sata.h | 3 +++
6 files changed, 74 insertions(+), 1 deletion(-)
diff --git a/Makefile.inc b/Makefile.inc
index 0c688f7..03b4489 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -52,7 +52,7 @@ PHONY+= clean-abuild coreboot lint lint-stable build-dirs
#######################################################################
# root source directories of coreboot
-subdirs-y := src/lib src/console src/device
+subdirs-y := src/lib src/console src/device src/acpi
subdirs-y += src/ec/acpi $(wildcard src/ec/*/*) $(wildcard src/southbridge/*/*)
subdirs-y += $(wildcard src/soc/*/*) $(wildcard src/northbridge/*/*)
subdirs-y += src/superio $(wildcard src/drivers/*) src/cpu src/vendorcode
diff --git a/src/Kconfig b/src/Kconfig
index 26e1194..fffe7a3 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -329,6 +329,8 @@ config RAM_CODE_SUPPORT
endmenu
+source "src/acpi/Kconfig"
+
source "src/mainboard/Kconfig"
source "src/arch/*/Kconfig"
diff --git a/src/acpi/Kconfig b/src/acpi/Kconfig
new file mode 100644
index 0000000..e025f99
--- /dev/null
+++ b/src/acpi/Kconfig
@@ -0,0 +1,6 @@
+
+config ACPI_SATA_GENERATOR
+ bool
+ default n
+ help
+ Use acpi sata port generator.
diff --git a/src/acpi/Makefile.inc b/src/acpi/Makefile.inc
new file mode 100644
index 0000000..53ac679
--- /dev/null
+++ b/src/acpi/Makefile.inc
@@ -0,0 +1 @@
+ramstage-$(CONFIG_ACPI_SATA_GENERATOR) += sata.c
diff --git a/src/acpi/sata.c b/src/acpi/sata.c
new file mode 100644
index 0000000..b488574
--- /dev/null
+++ b/src/acpi/sata.c
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2015 Alexander Couzens <lynxis(a)fe80.eu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#include "sata.h"
+
+#include <arch/acpi.h>
+#include <arch/acpigen.h>
+
+/* e.g.
+ * generate_sata_ssdt_ports("\_SB.PCI0.SATA", 0x3);
+ * generates:
+ * Scope (\_SB.PCI0.SATA)
+ * {
+ * Device (PRT0)
+ * {
+ * Name (_ADR, 0x0000FFFF) // _ADR: Address
+ * }
+ *
+ * Device (PRT1)
+ * {
+ * Name (_ADR, 0x0001FFFF) // _ADR: Address
+ * }
+ * }
+ */
+void generate_sata_ssdt_ports(const char *scope, uint8_t enable_map)
+{
+ int i;
+ int bit;
+ char port_name[4] = "PRT0";
+
+ acpigen_write_scope(scope);
+
+ /* generate a device for every enabled port */
+ for (i = 0; i < 8; i++) {
+ bit = 1 << i;
+ if (!(bit & enable_map))
+ continue;
+
+ port_name[3] = '0' + i;
+ acpigen_write_device(port_name);
+
+ acpigen_write_name_dword("_ADR", 0xffff + i * 0x10000);
+ acpigen_pop_len(); /* close PRT%d */
+ }
+
+ acpigen_pop_len(); /* close scope */
+}
diff --git a/src/acpi/sata.h b/src/acpi/sata.h
new file mode 100644
index 0000000..b7f17b2
--- /dev/null
+++ b/src/acpi/sata.h
@@ -0,0 +1,3 @@
+#include <stdint.h>
+
+void generate_sata_ssdt_ports(const char *scope, uint8_t enable_map);