OpenBIOS
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1999 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1998 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1997 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1996 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1995 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1994 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1993 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1992 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1991 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1990 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1989 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1988 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1987 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1986 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1985 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1984 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1983 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1982 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1981 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1980 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1979 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1978 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1977 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1976 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1975 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1974 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1973 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1972 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1971 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1970 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1969 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1968 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1967 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1966 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1965 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1964 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1963 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1962 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1961 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1960 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1959 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1958 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1957 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1956 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1955 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1954 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1953 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1952 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1951 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1950 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1949 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1948 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1947 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1946 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1945 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1944 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1943 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1942 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1941 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1940 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1939 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1938 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1937 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1936 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1935 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1934 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1933 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1932 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1931 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1930 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1929 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1928 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1927 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1926 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1925 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1924 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1923 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1922 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1921 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1920 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1919 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1918 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1917 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1916 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1915 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1914 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1913 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1912 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1911 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1910 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1909 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1908 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1907 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1906 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1905 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1904 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
August 2010
- 13 participants
- 46 discussions
Author: mcayland
Date: Wed Aug 11 22:57:53 2010
New Revision: 851
URL: http://tracker.coreboot.org/trac/openbios/changeset/851
Log:
Revert commit r850 - on reflection, keeping a separate v2 function for obp_devclose() seems a little excessive.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)siriusit.co.uk>
Modified:
trunk/openbios-devel/arch/sparc32/romvec.c
Modified: trunk/openbios-devel/arch/sparc32/romvec.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/romvec.c Wed Aug 11 18:41:36 2010 (r850)
+++ trunk/openbios-devel/arch/sparc32/romvec.c Wed Aug 11 22:57:53 2010 (r851)
@@ -279,26 +279,17 @@
static int obp_devclose(int dev_desc)
{
- int ret = 1;
+ int ret;
PUSH(dev_desc);
fword("close-dev");
+ ret = POP();
DPRINTF("obp_devclose(0x%x) = %d\n", dev_desc, ret);
return ret;
}
-static void obp_devclose_v2(int dev_desc)
-{
- PUSH(dev_desc);
- fword("close-dev");
-
- DPRINTF("obp_devclose_v2(0x%x)\n", dev_desc);
-
- return;
-}
-
static int obp_rdblkdev(int dev_desc, int num_blks, int offset, char *buf)
{
int ret, hi, lo, bs;
@@ -468,7 +459,7 @@
romvec0.pv_v2devops.v2_dumb_mmap = obp_dumb_mmap;
romvec0.pv_v2devops.v2_dumb_munmap = obp_dumb_munmap;
romvec0.pv_v2devops.v2_dev_open = obp_devopen;
- romvec0.pv_v2devops.v2_dev_close = obp_devclose_v2;
+ romvec0.pv_v2devops.v2_dev_close = (void (*)(int))obp_devclose;
romvec0.pv_v2devops.v2_dev_read = obp_devread;
romvec0.pv_v2devops.v2_dev_write = obp_devwrite;
romvec0.pv_v2devops.v2_dev_seek = obp_devseek;
1
0
Author: mcayland
Date: Wed Aug 11 18:41:36 2010
New Revision: 850
URL: http://tracker.coreboot.org/trac/openbios/changeset/850
Log:
Fix up obp_devclose on SPARC32 - Forth's close-dev doesn't actually return a result code, so we fix it as 1 (to indicate success) for the v0
callback as suggested by Google, and simply return nothing for the v2 callback as indicated by the romvec structure. This allows us to remove the
extra POP() which was causing a stack underflow error which was affecting Solaris 8 installation kernel boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)siriusit.co.uk>
Modified:
trunk/openbios-devel/arch/sparc32/romvec.c
Modified: trunk/openbios-devel/arch/sparc32/romvec.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/romvec.c Tue Aug 10 20:16:46 2010 (r849)
+++ trunk/openbios-devel/arch/sparc32/romvec.c Wed Aug 11 18:41:36 2010 (r850)
@@ -279,17 +279,26 @@
static int obp_devclose(int dev_desc)
{
- int ret;
+ int ret = 1;
PUSH(dev_desc);
fword("close-dev");
- ret = POP();
DPRINTF("obp_devclose(0x%x) = %d\n", dev_desc, ret);
return ret;
}
+static void obp_devclose_v2(int dev_desc)
+{
+ PUSH(dev_desc);
+ fword("close-dev");
+
+ DPRINTF("obp_devclose_v2(0x%x)\n", dev_desc);
+
+ return;
+}
+
static int obp_rdblkdev(int dev_desc, int num_blks, int offset, char *buf)
{
int ret, hi, lo, bs;
@@ -459,7 +468,7 @@
romvec0.pv_v2devops.v2_dumb_mmap = obp_dumb_mmap;
romvec0.pv_v2devops.v2_dumb_munmap = obp_dumb_munmap;
romvec0.pv_v2devops.v2_dev_open = obp_devopen;
- romvec0.pv_v2devops.v2_dev_close = (void (*)(int))obp_devclose;
+ romvec0.pv_v2devops.v2_dev_close = obp_devclose_v2;
romvec0.pv_v2devops.v2_dev_read = obp_devread;
romvec0.pv_v2devops.v2_dev_write = obp_devwrite;
romvec0.pv_v2devops.v2_dev_seek = obp_devseek;
1
0
[commit] r849 - in trunk/openbios-devel: arch/sparc32 drivers include/drivers
by repository service Aug. 10, 2010
by repository service Aug. 10, 2010
Aug. 10, 2010
Author: blueswirl
Date: Tue Aug 10 20:16:46 2010
New Revision: 849
URL: http://tracker.coreboot.org/trac/openbios/changeset/849
Log:
sparc32: move last fw_cfg user to openbios.c
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/arch/sparc32/openbios.c
trunk/openbios-devel/drivers/obio.c
trunk/openbios-devel/include/drivers/drivers.h
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Tue Aug 10 19:51:53 2010 (r848)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Tue Aug 10 20:16:46 2010 (r849)
@@ -828,6 +828,7 @@
uint32_t temp;
uint16_t machine_id;
char buf[256];
+ unsigned long mem_size;
fw_cfg_init();
@@ -853,9 +854,11 @@
ob_init_mmu();
ob_init_iommu(hwdef->iommu_base);
#ifdef CONFIG_DRIVER_OBIO
+ mem_size = fw_cfg_read_i32(FW_CFG_RAM_SIZE);
ob_obio_init(hwdef->slavio_base, hwdef->fd_offset,
hwdef->counter_offset, hwdef->intr_offset,
- hwdef->aux1_offset, hwdef->aux2_offset);
+ hwdef->aux1_offset, hwdef->aux2_offset,
+ mem_size);
setup_machine(hwdef->slavio_base);
Modified: trunk/openbios-devel/drivers/obio.c
==============================================================================
--- trunk/openbios-devel/drivers/obio.c Tue Aug 10 19:51:53 2010 (r848)
+++ trunk/openbios-devel/drivers/obio.c Tue Aug 10 20:16:46 2010 (r849)
@@ -20,8 +20,6 @@
#include "arch/common/nvram.h"
#include "libopenbios/ofmem.h"
#include "obio.h"
-#define NO_QEMU_PROTOS
-#include "arch/common/fw_cfg.h"
#include "escc.h"
#define PROMDEV_KBD 0 /* input from keyboard */
@@ -402,12 +400,9 @@
}
static void
-ob_smp_init(void)
+ob_smp_init(unsigned long mem_size)
{
- unsigned long mem_size;
-
// See arch/sparc32/entry.S for memory layout
- mem_size = fw_cfg_read_i32(FW_CFG_RAM_SIZE);
smp_header = (struct smp_cfg *)map_io((uint64_t)(mem_size - 0x100),
sizeof(struct smp_cfg));
}
@@ -499,7 +494,8 @@
int
ob_obio_init(uint64_t slavio_base, unsigned long fd_offset,
unsigned long counter_offset, unsigned long intr_offset,
- unsigned long aux1_offset, unsigned long aux2_offset)
+ unsigned long aux1_offset, unsigned long aux2_offset,
+ unsigned long mem_size)
{
// All devices were integrated to NCR89C105, see
@@ -534,7 +530,7 @@
ob_interrupt_init(slavio_base, intr_offset);
- ob_smp_init();
+ ob_smp_init(mem_size);
return 0;
}
Modified: trunk/openbios-devel/include/drivers/drivers.h
==============================================================================
--- trunk/openbios-devel/include/drivers/drivers.h Tue Aug 10 19:51:53 2010 (r848)
+++ trunk/openbios-devel/include/drivers/drivers.h Tue Aug 10 20:16:46 2010 (r849)
@@ -64,7 +64,8 @@
/* drivers/obio.c */
int ob_obio_init(uint64_t slavio_base, unsigned long fd_offset,
unsigned long counter_offset, unsigned long intr_offset,
- unsigned long aux1_offset, unsigned long aux2_offset);
+ unsigned long aux1_offset, unsigned long aux2_offset,
+ unsigned long mem_size);
int start_cpu(unsigned int pc, unsigned int context_ptr, unsigned int context,
int cpu);
void ob_eccmemctl_init(uint64_t base);
1
0
[commit] r848 - in trunk/openbios-devel: arch/sparc32 drivers include/drivers
by repository service Aug. 10, 2010
by repository service Aug. 10, 2010
Aug. 10, 2010
Author: blueswirl
Date: Tue Aug 10 19:51:53 2010
New Revision: 848
URL: http://tracker.coreboot.org/trac/openbios/changeset/848
Log:
sparc32: move machine setup to openbios.c
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/arch/sparc32/openbios.c
trunk/openbios-devel/drivers/obio.c
trunk/openbios-devel/include/drivers/drivers.h
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Mon Aug 9 22:41:45 2010 (r847)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Tue Aug 10 19:51:53 2010 (r848)
@@ -602,6 +602,126 @@
}
}
+static void dummy_mach_init(uint64_t base)
+{
+}
+
+struct machdef {
+ uint16_t machine_id;
+ const char *banner_name;
+ const char *model;
+ const char *name;
+ void (*initfn)(uint64_t base);
+};
+
+static const struct machdef sun4m_defs[] = {
+ {
+ .machine_id = 32,
+ .banner_name = "SPARCstation 5",
+ .model = "SUNW,501-3059",
+ .name = "SUNW,SPARCstation-5",
+ .initfn = ss5_init,
+ },
+ {
+ .machine_id = 33,
+ .banner_name = "SPARCstation Voyager",
+ .model = "SUNW,501-2581",
+ .name = "SUNW,SPARCstation-Voyager",
+ .initfn = dummy_mach_init,
+ },
+ {
+ .machine_id = 34,
+ .banner_name = "SPARCstation LX",
+ .model = "SUNW,501-2031",
+ .name = "SUNW,SPARCstation-LX",
+ .initfn = dummy_mach_init,
+ },
+ {
+ .machine_id = 35,
+ .banner_name = "SPARCstation 4",
+ .model = "SUNW,501-2572",
+ .name = "SUNW,SPARCstation-4",
+ .initfn = ss5_init,
+ },
+ {
+ .machine_id = 36,
+ .banner_name = "SPARCstation Classic",
+ .model = "SUNW,501-2326",
+ .name = "SUNW,SPARCstation-Classic",
+ .initfn = dummy_mach_init,
+ },
+ {
+ .machine_id = 37,
+ .banner_name = "Tadpole S3 GX",
+ .model = "S3",
+ .name = "Tadpole_S3GX",
+ .initfn = ss5_init,
+ },
+ {
+ .machine_id = 64,
+ .banner_name = "SPARCstation 10 (1 X 390Z55)",
+ .model = "SUNW,S10,501-2365",
+ .name = "SUNW,SPARCstation-10",
+ .initfn = ob_eccmemctl_init,
+ },
+ {
+ .machine_id = 65,
+ .banner_name = "SPARCstation 20 (1 X 390Z55)",
+ .model = "SUNW,S20,501-2324",
+ .name = "SUNW,SPARCstation-20",
+ .initfn = ob_eccmemctl_init,
+ },
+ {
+ .machine_id = 66,
+ .banner_name = "SPARCsystem 600(1 X 390Z55)",
+ .model = NULL,
+ .name = "SUNW,SPARCsystem-600",
+ .initfn = ob_eccmemctl_init,
+ },
+};
+
+static const struct machdef *
+id_machine(uint16_t machine_id)
+{
+ unsigned int i;
+
+ for (i = 0; i < sizeof(sun4m_defs)/sizeof(struct machdef); i++) {
+ if (machine_id == sun4m_defs[i].machine_id)
+ return &sun4m_defs[i];
+ }
+ printk("Unknown machine (ID %d), freezing!\n", machine_id);
+ for (;;);
+}
+
+static void setup_machine(uint64_t base)
+{
+ uint16_t machine_id;
+ const struct machdef *mach;
+
+ machine_id = fw_cfg_read_i16(FW_CFG_MACHINE_ID);
+ mach = id_machine(machine_id);
+
+ push_str("/");
+ fword("find-device");
+ push_str(mach->banner_name);
+ fword("encode-string");
+ push_str("banner-name");
+ fword("property");
+
+ if (mach->model) {
+ push_str(mach->model);
+ fword("encode-string");
+ push_str("model");
+ fword("property");
+ }
+ push_str(mach->name);
+ fword("encode-string");
+ push_str("name");
+ fword("property");
+
+ mach->initfn(base);
+}
+
/* Add /uuid */
static void setup_uuid(void)
{
@@ -736,6 +856,9 @@
ob_obio_init(hwdef->slavio_base, hwdef->fd_offset,
hwdef->counter_offset, hwdef->intr_offset,
hwdef->aux1_offset, hwdef->aux2_offset);
+
+ setup_machine(hwdef->slavio_base);
+
nvconf_init();
#endif
#ifdef CONFIG_DRIVER_SBUS
Modified: trunk/openbios-devel/drivers/obio.c
==============================================================================
--- trunk/openbios-devel/drivers/obio.c Mon Aug 9 22:41:45 2010 (r847)
+++ trunk/openbios-devel/drivers/obio.c Tue Aug 10 19:51:53 2010 (r848)
@@ -105,7 +105,7 @@
fword("property");
}
-static void
+void
ob_eccmemctl_init(uint64_t base)
{
uint32_t version, *regs;
@@ -169,11 +169,7 @@
return NVRAM_OB_SIZE;
}
-static void dummy_mach_init(uint64_t base)
-{
-}
-
-static void
+void
ss5_init(uint64_t base)
{
ob_new_obio_device("slavioconfig", NULL);
@@ -183,122 +179,6 @@
fword("finish-device");
}
-struct machdef {
- uint16_t machine_id;
- const char *banner_name;
- const char *model;
- const char *name;
- void (*initfn)(uint64_t base);
-};
-
-static const struct machdef sun4m_defs[] = {
- {
- .machine_id = 32,
- .banner_name = "SPARCstation 5",
- .model = "SUNW,501-3059",
- .name = "SUNW,SPARCstation-5",
- .initfn = ss5_init,
- },
- {
- .machine_id = 33,
- .banner_name = "SPARCstation Voyager",
- .model = "SUNW,501-2581",
- .name = "SUNW,SPARCstation-Voyager",
- .initfn = dummy_mach_init,
- },
- {
- .machine_id = 34,
- .banner_name = "SPARCstation LX",
- .model = "SUNW,501-2031",
- .name = "SUNW,SPARCstation-LX",
- .initfn = dummy_mach_init,
- },
- {
- .machine_id = 35,
- .banner_name = "SPARCstation 4",
- .model = "SUNW,501-2572",
- .name = "SUNW,SPARCstation-4",
- .initfn = ss5_init,
- },
- {
- .machine_id = 36,
- .banner_name = "SPARCstation Classic",
- .model = "SUNW,501-2326",
- .name = "SUNW,SPARCstation-Classic",
- .initfn = dummy_mach_init,
- },
- {
- .machine_id = 37,
- .banner_name = "Tadpole S3 GX",
- .model = "S3",
- .name = "Tadpole_S3GX",
- .initfn = ss5_init,
- },
- {
- .machine_id = 64,
- .banner_name = "SPARCstation 10 (1 X 390Z55)",
- .model = "SUNW,S10,501-2365",
- .name = "SUNW,SPARCstation-10",
- .initfn = ob_eccmemctl_init,
- },
- {
- .machine_id = 65,
- .banner_name = "SPARCstation 20 (1 X 390Z55)",
- .model = "SUNW,S20,501-2324",
- .name = "SUNW,SPARCstation-20",
- .initfn = ob_eccmemctl_init,
- },
- {
- .machine_id = 66,
- .banner_name = "SPARCsystem 600(1 X 390Z55)",
- .model = NULL,
- .name = "SUNW,SPARCsystem-600",
- .initfn = ob_eccmemctl_init,
- },
-};
-
-static const struct machdef *
-id_machine(uint16_t machine_id)
-{
- unsigned int i;
-
- for (i = 0; i < sizeof(sun4m_defs)/sizeof(struct machdef); i++) {
- if (machine_id == sun4m_defs[i].machine_id)
- return &sun4m_defs[i];
- }
- printk("Unknown machine (ID %d), freezing!\n", machine_id);
- for (;;);
-}
-
-static void setup_machine(uint64_t base)
-{
- uint16_t machine_id;
- const struct machdef *mach;
-
- machine_id = fw_cfg_read_i16(FW_CFG_MACHINE_ID);
- mach = id_machine(machine_id);
-
- push_str("/");
- fword("find-device");
- push_str(mach->banner_name);
- fword("encode-string");
- push_str("banner-name");
- fword("property");
-
- if (mach->model) {
- push_str(mach->model);
- fword("encode-string");
- push_str("model");
- fword("property");
- }
- push_str(mach->name);
- fword("encode-string");
- push_str("name");
- fword("property");
-
- mach->initfn(base);
-}
-
static void
ob_nvram_init(uint64_t base, uint64_t offset)
{
@@ -632,8 +512,6 @@
#endif
ob_set_obio_ranges(slavio_base);
- setup_machine(slavio_base);
-
// Zilog Z8530 serial ports, see http://www.zilog.com
// Must be before zs@0,0 or Linux won't boot
ob_zs_init(slavio_base, SLAVIO_ZS1, ZS_INTR, 0, 0);
Modified: trunk/openbios-devel/include/drivers/drivers.h
==============================================================================
--- trunk/openbios-devel/include/drivers/drivers.h Mon Aug 9 22:41:45 2010 (r847)
+++ trunk/openbios-devel/include/drivers/drivers.h Tue Aug 10 19:51:53 2010 (r848)
@@ -67,6 +67,8 @@
unsigned long aux1_offset, unsigned long aux2_offset);
int start_cpu(unsigned int pc, unsigned int context_ptr, unsigned int context,
int cpu);
+void ob_eccmemctl_init(uint64_t base);
+void ss5_init(uint64_t base);
/* drivers/iommu.c */
void ob_init_iommu(uint64_t base);
1
0
[commit] r846 - in trunk/openbios-devel: arch/sparc32 arch/sparc64 packages
by repository service Aug. 9, 2010
by repository service Aug. 9, 2010
Aug. 9, 2010
Author: blueswirl
Date: Mon Aug 9 21:21:22 2010
New Revision: 846
URL: http://tracker.coreboot.org/trac/openbios/changeset/846
Log:
sparc: fix partition probe, try two partitions
If the size of the partition currently being probed is zero,
fail the probe. This lets Forth code try the next candidate from
boot-device list.
Add explicit ':d' (Sparc32, 'f' for Sparc64) partition to
CDROM probe list, so we can remove the ugly forced partition logic.
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/arch/sparc32/openbios.c
trunk/openbios-devel/arch/sparc64/openbios.c
trunk/openbios-devel/packages/sun-parts.c
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Sun Aug 8 23:20:15 2010 (r845)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Mon Aug 9 21:21:22 2010 (r846)
@@ -784,7 +784,7 @@
break;
default:
case 'd':
- push_str("cdrom");
+ push_str("cdrom:d cdrom");
break;
case 'n':
push_str("net");
Modified: trunk/openbios-devel/arch/sparc64/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc64/openbios.c Sun Aug 8 23:20:15 2010 (r845)
+++ trunk/openbios-devel/arch/sparc64/openbios.c Mon Aug 9 21:21:22 2010 (r846)
@@ -480,7 +480,7 @@
break;
default:
case 'd':
- push_str("cdrom");
+ push_str("cdrom:f cdrom");
break;
case 'n':
push_str("net");
Modified: trunk/openbios-devel/packages/sun-parts.c
==============================================================================
--- trunk/openbios-devel/packages/sun-parts.c Sun Aug 8 23:20:15 2010 (r845)
+++ trunk/openbios-devel/packages/sun-parts.c Mon Aug 9 21:21:22 2010 (r846)
@@ -175,10 +175,6 @@
__be32_to_cpu(p->partitions[i].num_sectors),
__be16_to_cpu(p->infos[i].id),
__be16_to_cpu(p->infos[i].flags));
- if (parnum < 0) {
- if (p->partitions[i].num_sectors != 0 && p->infos[i].id != 0)
- parnum = i;
- }
}
if (parnum < 0)
@@ -192,6 +188,10 @@
di->offs_hi = offs >> BITS;
di->offs_lo = offs & (ucell) -1;
size = (long long)__be32_to_cpu(p->partitions[parnum].num_sectors) * bs;
+ if (size == 0) {
+ DPRINTF("Partition size is 0, exiting\n");
+ RET(0);
+ }
di->size_hi = size >> BITS;
di->size_lo = size & (ucell) -1;
di->type = __be16_to_cpu(p->infos[parnum].id);
1
0
Aug. 9, 2010
Author: blueswirl
Date: Tue Aug 3 22:48:23 2010
New Revision: 832
URL: http://tracker.coreboot.org/trac/openbios/changeset/832
Log:
sparc32: fix pre-loaded kernel command line
Fix more breakage from r828:
For some reason, QEMU/Sparc32 does not set FW_CFG_CMDLINE_SIZE, so
we have to use FW_CFG_KERNEL_CMDLINE instead.
Setup romvec obp_arg.argv[1] and "boot-file" property.
Remove obsolete command line setup code from obio.c.
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/arch/sparc32/openbios.c
trunk/openbios-devel/drivers/obio.c
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Tue Aug 3 20:39:27 2010 (r831)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Tue Aug 3 22:48:23 2010 (r832)
@@ -20,6 +20,7 @@
#include "libopenbios/sys_info.h"
#include "openbios.h"
#include "boot.h"
+#include "openprom.h"
#include "packages/video.h"
#define NO_QEMU_PROTOS
#include "arch/common/fw_cfg.h"
@@ -134,7 +135,8 @@
arch_init( void )
{
static char cmdline[128];
- int size;
+ int size = 0;
+ const char *kernel_cmdline;
openbios_init();
modules_init();
@@ -154,25 +156,31 @@
#endif
device_end();
+ /* Initialiase openprom romvec */
+ romvec = init_openprom();
+
kernel_size = fw_cfg_read_i32(FW_CFG_KERNEL_SIZE);
if (kernel_size)
kernel_image = fw_cfg_read_i32(FW_CFG_KERNEL_ADDR);
- size = fw_cfg_read_i32(FW_CFG_CMDLINE_SIZE);
- if (size) {
- fw_cfg_read(FW_CFG_CMDLINE_DATA, cmdline, size);
- }
+ kernel_cmdline = (const char *) fw_cfg_read_i32(FW_CFG_KERNEL_CMDLINE);
+ if (kernel_cmdline) {
+ size = strlen(kernel_cmdline);
+ memcpy(cmdline, kernel_cmdline, size);
+ obp_arg.argv[1] = cmdline;
+ }
cmdline[size] = '\0';
qemu_cmdline = (uint32_t)cmdline;
- boot_device = fw_cfg_read_i16(FW_CFG_BOOT_DEVICE);
-
- /* Initialiase openprom romvec */
- romvec = init_openprom();
+ /* Setup nvram variables */
+ push_str("/options");
+ fword("find-device");
+ push_str(cmdline);
+ fword("encode-string");
+ push_str("boot-file");
+ fword("property");
- /* Setup nvram variables */
- push_str("/options");
- fword("find-device");
+ boot_device = fw_cfg_read_i16(FW_CFG_BOOT_DEVICE);
switch (boot_device) {
case 'a':
@@ -194,11 +202,6 @@
push_str("boot-device");
fword("property");
- push_str("");
- fword("encode-string");
- push_str("boot-file");
- fword("property");
-
/* Set up other properties */
push_str("/chosen");
fword("find-device");
Modified: trunk/openbios-devel/drivers/obio.c
==============================================================================
--- trunk/openbios-devel/drivers/obio.c Tue Aug 3 20:39:27 2010 (r831)
+++ trunk/openbios-devel/drivers/obio.c Tue Aug 3 22:48:23 2010 (r832)
@@ -38,12 +38,6 @@
*/
#define SUN4M_NCPU 4
-/* The kernel may want to examine the arguments, so hold a copy in OBP's
- * mapped memory.
- */
-#define OBIO_CMDLINE_MAX 256
-static char obio_cmdline[OBIO_CMDLINE_MAX];
-
/* DECLARE data structures for the nodes. */
DECLARE_UNNAMED_NODE( ob_obio, INSTALL_OPEN, sizeof(int) );
@@ -651,14 +645,12 @@
const char *stdin, *stdout;
unsigned int i;
char nographic;
- uint32_t size = 0;
uint16_t machine_id;
const struct cpudef *cpu;
const struct machdef *mach;
char buf[256];
uint32_t temp;
phandle_t chosen;
- const char *kernel_cmdline;
ob_new_obio_device("eeprom", NULL);
@@ -691,21 +683,6 @@
for(;;);
}
- kernel_size = fw_cfg_read_i32(FW_CFG_KERNEL_SIZE);
- if (kernel_size)
- kernel_image = fw_cfg_read_i32(FW_CFG_KERNEL_ADDR);
- kernel_cmdline = (const char *) fw_cfg_read_i32(FW_CFG_KERNEL_CMDLINE);
- if (kernel_cmdline) {
- size = strlen(kernel_cmdline);
- if (size > OBIO_CMDLINE_MAX - 1)
- size = OBIO_CMDLINE_MAX - 1;
- memcpy(&obio_cmdline, kernel_cmdline, size);
- }
- obio_cmdline[size] = '\0';
- qemu_cmdline = (uint32_t) &obio_cmdline;
- cmdline_size = size;
- boot_device = fw_cfg_read_i16(FW_CFG_BOOT_DEVICE);
-
fw_cfg_read(FW_CFG_NOGRAPHIC, &nographic, 1);
graphic_depth = fw_cfg_read_i16(FW_CFG_SUN4M_DEPTH);
5
17
Aug. 8, 2010
Author: blueswirl
Date: Sun Aug 8 23:20:15 2010
New Revision: 845
URL: http://tracker.coreboot.org/trac/openbios/changeset/845
Log:
sparc32: move CPU setup to openbios.c
Move initial banner printing, CPU setup and graphic_depth
setup to openbios.c.
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/arch/sparc32/openbios.c
trunk/openbios-devel/drivers/obio.c
trunk/openbios-devel/drivers/obio.h
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Sun Aug 8 22:03:38 2010 (r844)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Sun Aug 8 23:20:15 2010 (r845)
@@ -28,6 +28,7 @@
#define MEMORY_SIZE (128*1024) /* 16K ram for hosted system */
#define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */
#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
+#define FW_CFG_SUN4M_DEPTH (FW_CFG_ARCH_LOCAL + 0x00)
static ucell *memory;
@@ -40,6 +41,7 @@
unsigned long aux1_offset, aux2_offset;
uint64_t dma_base, esp_base, le_base;
uint64_t tcx_base;
+ int mid_offset;
int machine_id_low, machine_id_high;
};
@@ -60,6 +62,7 @@
.dma_base = 0x78400000,
.esp_base = 0x78800000,
.le_base = 0x78c00000,
+ .mid_offset = 0,
.machine_id_low = 32,
.machine_id_high = 63,
},
@@ -79,6 +82,7 @@
.dma_base = 0xef0400000ULL,
.esp_base = 0xef0800000ULL,
.le_base = 0xef0c00000ULL,
+ .mid_offset = 8,
.machine_id_low = 64,
.machine_id_high = 65,
},
@@ -98,6 +102,7 @@
.dma_base = 0xef0081000ULL,
.esp_base = 0xef0080000ULL,
.le_base = 0xef0060000ULL,
+ .mid_offset = 8,
.machine_id_low = 66,
.machine_id_high = 66,
},
@@ -117,6 +122,486 @@
{
}
+static void mb86904_init(void)
+{
+ PUSH(32);
+ fword("encode-int");
+ push_str("cache-line-size");
+ fword("property");
+
+ PUSH(512);
+ fword("encode-int");
+ push_str("cache-nlines");
+ fword("property");
+
+ PUSH(0x23);
+ fword("encode-int");
+ push_str("mask_rev");
+ fword("property");
+}
+
+static void tms390z55_init(void)
+{
+ push_str("");
+ fword("encode-string");
+ push_str("ecache-parity?");
+ fword("property");
+
+ push_str("");
+ fword("encode-string");
+ push_str("bfill?");
+ fword("property");
+
+ push_str("");
+ fword("encode-string");
+ push_str("bcopy?");
+ fword("property");
+
+ push_str("");
+ fword("encode-string");
+ push_str("cache-physical?");
+ fword("property");
+
+ PUSH(0xf);
+ fword("encode-int");
+ PUSH(0xf8fffffc);
+ fword("encode-int");
+ fword("encode+");
+ PUSH(4);
+ fword("encode-int");
+ fword("encode+");
+
+ PUSH(0xf);
+ fword("encode-int");
+ fword("encode+");
+ PUSH(0xf8c00000);
+ fword("encode-int");
+ fword("encode+");
+ PUSH(0x1000);
+ fword("encode-int");
+ fword("encode+");
+
+ PUSH(0xf);
+ fword("encode-int");
+ fword("encode+");
+ PUSH(0xf8000000);
+ fword("encode-int");
+ fword("encode+");
+ PUSH(0x1000);
+ fword("encode-int");
+ fword("encode+");
+
+ PUSH(0xf);
+ fword("encode-int");
+ fword("encode+");
+ PUSH(0xf8800000);
+ fword("encode-int");
+ fword("encode+");
+ PUSH(0x1000);
+ fword("encode-int");
+ fword("encode+");
+ push_str("reg");
+ fword("property");
+}
+
+static void rt625_init(void)
+{
+ PUSH(32);
+ fword("encode-int");
+ push_str("cache-line-size");
+ fword("property");
+
+ PUSH(512);
+ fword("encode-int");
+ push_str("cache-nlines");
+ fword("property");
+
+}
+
+static void bad_cpu_init(void)
+{
+ printk("This CPU is not supported yet, freezing.\n");
+ for(;;);
+}
+
+struct cpudef {
+ unsigned long iu_version;
+ const char *name;
+ int psr_impl, psr_vers, impl, vers;
+ int dcache_line_size, dcache_lines, dcache_assoc;
+ int icache_line_size, icache_lines, icache_assoc;
+ int ecache_line_size, ecache_lines, ecache_assoc;
+ int mmu_nctx;
+ void (*initfn)(void);
+};
+
+static const struct cpudef sparc_defs[] = {
+ {
+ .iu_version = 0x00 << 24, /* Impl 0, ver 0 */
+ .name = "FMI,MB86900",
+ .initfn = bad_cpu_init,
+ },
+ {
+ .iu_version = 0x04 << 24, /* Impl 0, ver 4 */
+ .name = "FMI,MB86904",
+ .psr_impl = 0,
+ .psr_vers = 5,
+ .impl = 0,
+ .vers = 5,
+ .dcache_line_size = 0x10,
+ .dcache_lines = 0x200,
+ .dcache_assoc = 1,
+ .icache_line_size = 0x20,
+ .icache_lines = 0x200,
+ .icache_assoc = 1,
+ .ecache_line_size = 0x20,
+ .ecache_lines = 0x4000,
+ .ecache_assoc = 1,
+ .mmu_nctx = 0x100,
+ .initfn = mb86904_init,
+ },
+ {
+ .iu_version = 0x05 << 24, /* Impl 0, ver 5 */
+ .name = "FMI,MB86907",
+ .psr_impl = 0,
+ .psr_vers = 5,
+ .impl = 0,
+ .vers = 5,
+ .dcache_line_size = 0x20,
+ .dcache_lines = 0x200,
+ .dcache_assoc = 1,
+ .icache_line_size = 0x20,
+ .icache_lines = 0x200,
+ .icache_assoc = 1,
+ .ecache_line_size = 0x20,
+ .ecache_lines = 0x4000,
+ .ecache_assoc = 1,
+ .mmu_nctx = 0x100,
+ .initfn = mb86904_init,
+ },
+ {
+ .iu_version = 0x10 << 24, /* Impl 1, ver 0 */
+ .name = "LSI,L64811",
+ .initfn = bad_cpu_init,
+ },
+ {
+ .iu_version = 0x11 << 24, /* Impl 1, ver 1 */
+ .name = "CY,CY7C601",
+ .psr_impl = 1,
+ .psr_vers = 1,
+ .impl = 1,
+ .vers = 1,
+ .mmu_nctx = 0x10,
+ .initfn = bad_cpu_init,
+ },
+ {
+ .iu_version = 0x13 << 24, /* Impl 1, ver 3 */
+ .name = "CY,CY7C611",
+ .initfn = bad_cpu_init,
+ },
+ {
+ .iu_version = 0x40000000,
+ .name = "TI,TMS390Z55",
+ .psr_impl = 4,
+ .psr_vers = 0,
+ .impl = 0,
+ .vers = 4,
+ .dcache_line_size = 0x20,
+ .dcache_lines = 0x80,
+ .dcache_assoc = 4,
+ .icache_line_size = 0x40,
+ .icache_lines = 0x40,
+ .icache_assoc = 5,
+ .ecache_line_size = 0x20,
+ .ecache_lines = 0x8000,
+ .ecache_assoc = 1,
+ .mmu_nctx = 0x10000,
+ .initfn = tms390z55_init,
+ },
+ {
+ .iu_version = 0x41000000,
+ .name = "TI,TMS390S10",
+ .psr_impl = 4,
+ .psr_vers = 1,
+ .impl = 4,
+ .vers = 1,
+ .dcache_line_size = 0x10,
+ .dcache_lines = 0x80,
+ .dcache_assoc = 4,
+ .icache_line_size = 0x20,
+ .icache_lines = 0x80,
+ .icache_assoc = 5,
+ .ecache_line_size = 0x20,
+ .ecache_lines = 0x8000,
+ .ecache_assoc = 1,
+ .mmu_nctx = 0x10000,
+ .initfn = tms390z55_init,
+ },
+ {
+ .iu_version = 0x42000000,
+ .name = "TI,TMS390S10",
+ .psr_impl = 4,
+ .psr_vers = 2,
+ .impl = 4,
+ .vers = 2,
+ .dcache_line_size = 0x10,
+ .dcache_lines = 0x80,
+ .dcache_assoc = 4,
+ .icache_line_size = 0x20,
+ .icache_lines = 0x80,
+ .icache_assoc = 5,
+ .ecache_line_size = 0x20,
+ .ecache_lines = 0x8000,
+ .ecache_assoc = 1,
+ .mmu_nctx = 0x10000,
+ .initfn = tms390z55_init,
+ },
+ {
+ .iu_version = 0x43000000,
+ .name = "TI,TMS390S10",
+ .psr_impl = 4,
+ .psr_vers = 3,
+ .impl = 4,
+ .vers = 3,
+ .dcache_line_size = 0x10,
+ .dcache_lines = 0x80,
+ .dcache_assoc = 4,
+ .icache_line_size = 0x20,
+ .icache_lines = 0x80,
+ .icache_assoc = 5,
+ .ecache_line_size = 0x20,
+ .ecache_lines = 0x8000,
+ .ecache_assoc = 1,
+ .mmu_nctx = 0x10000,
+ .initfn = tms390z55_init,
+ },
+ {
+ .iu_version = 0x44000000,
+ .name = "TI,TMS390S10",
+ .psr_impl = 4,
+ .psr_vers = 4,
+ .impl = 4,
+ .vers = 4,
+ .dcache_line_size = 0x10,
+ .dcache_lines = 0x80,
+ .dcache_assoc = 4,
+ .icache_line_size = 0x20,
+ .icache_lines = 0x80,
+ .icache_assoc = 5,
+ .ecache_line_size = 0x20,
+ .ecache_lines = 0x8000,
+ .ecache_assoc = 1,
+ .mmu_nctx = 0x10000,
+ .initfn = tms390z55_init,
+ },
+ {
+ .iu_version = 0x1e000000,
+ .name = "Ross,RT625",
+ .psr_impl = 1,
+ .psr_vers = 14,
+ .impl = 1,
+ .vers = 7,
+ .dcache_line_size = 0x20,
+ .dcache_lines = 0x80,
+ .dcache_assoc = 4,
+ .icache_line_size = 0x40,
+ .icache_lines = 0x40,
+ .icache_assoc = 5,
+ .ecache_line_size = 0x20,
+ .ecache_lines = 0x8000,
+ .ecache_assoc = 1,
+ .mmu_nctx = 0x10000,
+ .initfn = rt625_init,
+ },
+ {
+ .iu_version = 0x1f000000,
+ .name = "Ross,RT620",
+ .psr_impl = 1,
+ .psr_vers = 15,
+ .impl = 1,
+ .vers = 7,
+ .dcache_line_size = 0x20,
+ .dcache_lines = 0x80,
+ .dcache_assoc = 4,
+ .icache_line_size = 0x40,
+ .icache_lines = 0x40,
+ .icache_assoc = 5,
+ .ecache_line_size = 0x20,
+ .ecache_lines = 0x8000,
+ .ecache_assoc = 1,
+ .mmu_nctx = 0x10000,
+ .initfn = rt625_init,
+ },
+ {
+ .iu_version = 0x20000000,
+ .name = "BIT,B5010",
+ .initfn = bad_cpu_init,
+ },
+ {
+ .iu_version = 0x50000000,
+ .name = "MC,MN10501",
+ .initfn = bad_cpu_init,
+ },
+ {
+ .iu_version = 0x90 << 24, /* Impl 9, ver 0 */
+ .name = "Weitek,W8601",
+ .initfn = bad_cpu_init,
+ },
+ {
+ .iu_version = 0xf2000000,
+ .name = "GR,LEON2",
+ .initfn = bad_cpu_init,
+ },
+ {
+ .iu_version = 0xf3000000,
+ .name = "GR,LEON3",
+ .initfn = bad_cpu_init,
+ },
+};
+
+static const struct cpudef *
+id_cpu(void)
+{
+ unsigned long iu_version;
+ unsigned int i;
+
+ asm("rd %%psr, %0\n"
+ : "=r"(iu_version) :);
+ iu_version &= 0xff000000;
+
+ for (i = 0; i < sizeof(sparc_defs)/sizeof(struct cpudef); i++) {
+ if (iu_version == sparc_defs[i].iu_version)
+ return &sparc_defs[i];
+ }
+ printk("Unknown cpu (psr %lx), freezing!\n", iu_version);
+ for (;;);
+}
+
+static void setup_cpu(int mid_offset)
+{
+ uint32_t temp;
+ unsigned int i;
+ const struct cpudef *cpu;
+
+ // Add cpus
+ temp = fw_cfg_read_i32(FW_CFG_NB_CPUS);
+
+ printk("CPUs: %x", temp);
+ cpu = id_cpu();
+ printk(" x %s\n", cpu->name);
+ for (i = 0; i < temp; i++) {
+ push_str("/");
+ fword("find-device");
+
+ fword("new-device");
+
+ push_str(cpu->name);
+ fword("device-name");
+
+ push_str("cpu");
+ fword("device-type");
+
+ PUSH(cpu->psr_impl);
+ fword("encode-int");
+ push_str("psr-implementation");
+ fword("property");
+
+ PUSH(cpu->psr_vers);
+ fword("encode-int");
+ push_str("psr-version");
+ fword("property");
+
+ PUSH(cpu->impl);
+ fword("encode-int");
+ push_str("implementation");
+ fword("property");
+
+ PUSH(cpu->vers);
+ fword("encode-int");
+ push_str("version");
+ fword("property");
+
+ PUSH(4096);
+ fword("encode-int");
+ push_str("page-size");
+ fword("property");
+
+ PUSH(cpu->dcache_line_size);
+ fword("encode-int");
+ push_str("dcache-line-size");
+ fword("property");
+
+ PUSH(cpu->dcache_lines);
+ fword("encode-int");
+ push_str("dcache-nlines");
+ fword("property");
+
+ PUSH(cpu->dcache_assoc);
+ fword("encode-int");
+ push_str("dcache-associativity");
+ fword("property");
+
+ PUSH(cpu->icache_line_size);
+ fword("encode-int");
+ push_str("icache-line-size");
+ fword("property");
+
+ PUSH(cpu->icache_lines);
+ fword("encode-int");
+ push_str("icache-nlines");
+ fword("property");
+
+ PUSH(cpu->icache_assoc);
+ fword("encode-int");
+ push_str("icache-associativity");
+ fword("property");
+
+ PUSH(cpu->ecache_line_size);
+ fword("encode-int");
+ push_str("ecache-line-size");
+ fword("property");
+
+ PUSH(cpu->ecache_lines);
+ fword("encode-int");
+ push_str("ecache-nlines");
+ fword("property");
+
+ PUSH(cpu->ecache_assoc);
+ fword("encode-int");
+ push_str("ecache-associativity");
+ fword("property");
+
+ PUSH(2);
+ fword("encode-int");
+ push_str("ncaches");
+ fword("property");
+
+ PUSH(cpu->mmu_nctx);
+ fword("encode-int");
+ push_str("mmu-nctx");
+ fword("property");
+
+ PUSH(8);
+ fword("encode-int");
+ push_str("sparc-version");
+ fword("property");
+
+ push_str("");
+ fword("encode-string");
+ push_str("cache-coherence?");
+ fword("property");
+
+ PUSH(i + mid_offset);
+ fword("encode-int");
+ push_str("mid");
+ fword("property");
+
+ cpu->initfn();
+
+ fword("finish-device");
+ }
+}
+
/* Add /uuid */
static void setup_uuid(void)
{
@@ -220,6 +705,28 @@
static char cmdline[128];
int size = 0;
const char *kernel_cmdline;
+ uint32_t temp;
+ uint16_t machine_id;
+ char buf[256];
+
+ fw_cfg_init();
+
+ fw_cfg_read(FW_CFG_SIGNATURE, buf, 4);
+ buf[4] = '\0';
+
+ printk("Configuration device id %s", buf);
+
+ temp = fw_cfg_read_i32(FW_CFG_ID);
+ machine_id = fw_cfg_read_i16(FW_CFG_MACHINE_ID);
+
+ printk(" version %d machine id %d\n", temp, machine_id);
+
+ if (temp != 1) {
+ printk("Incompatible configuration device version, freezing\n");
+ for(;;);
+ }
+
+ graphic_depth = fw_cfg_read_i16(FW_CFG_SUN4M_DEPTH);
openbios_init();
modules_init();
@@ -239,6 +746,8 @@
#endif
device_end();
+ setup_cpu(hwdef->mid_offset);
+
setup_stdio();
/* Initialiase openprom romvec */
romvec = init_openprom();
Modified: trunk/openbios-devel/drivers/obio.c
==============================================================================
--- trunk/openbios-devel/drivers/obio.c Sun Aug 8 22:03:38 2010 (r844)
+++ trunk/openbios-devel/drivers/obio.c Sun Aug 8 23:20:15 2010 (r845)
@@ -169,361 +169,6 @@
return NVRAM_OB_SIZE;
}
-static void mb86904_init(void)
-{
- PUSH(32);
- fword("encode-int");
- push_str("cache-line-size");
- fword("property");
-
- PUSH(512);
- fword("encode-int");
- push_str("cache-nlines");
- fword("property");
-
- PUSH(0x23);
- fword("encode-int");
- push_str("mask_rev");
- fword("property");
-}
-
-static void tms390z55_init(void)
-{
- push_str("");
- fword("encode-string");
- push_str("ecache-parity?");
- fword("property");
-
- push_str("");
- fword("encode-string");
- push_str("bfill?");
- fword("property");
-
- push_str("");
- fword("encode-string");
- push_str("bcopy?");
- fword("property");
-
- push_str("");
- fword("encode-string");
- push_str("cache-physical?");
- fword("property");
-
- PUSH(0xf);
- fword("encode-int");
- PUSH(0xf8fffffc);
- fword("encode-int");
- fword("encode+");
- PUSH(4);
- fword("encode-int");
- fword("encode+");
-
- PUSH(0xf);
- fword("encode-int");
- fword("encode+");
- PUSH(0xf8c00000);
- fword("encode-int");
- fword("encode+");
- PUSH(0x1000);
- fword("encode-int");
- fword("encode+");
-
- PUSH(0xf);
- fword("encode-int");
- fword("encode+");
- PUSH(0xf8000000);
- fword("encode-int");
- fword("encode+");
- PUSH(0x1000);
- fword("encode-int");
- fword("encode+");
-
- PUSH(0xf);
- fword("encode-int");
- fword("encode+");
- PUSH(0xf8800000);
- fword("encode-int");
- fword("encode+");
- PUSH(0x1000);
- fword("encode-int");
- fword("encode+");
- push_str("reg");
- fword("property");
-}
-
-static void rt625_init(void)
-{
- PUSH(32);
- fword("encode-int");
- push_str("cache-line-size");
- fword("property");
-
- PUSH(512);
- fword("encode-int");
- push_str("cache-nlines");
- fword("property");
-
-}
-
-static void bad_cpu_init(void)
-{
- printk("This CPU is not supported yet, freezing.\n");
- for(;;);
-}
-
-struct cpudef {
- unsigned long iu_version;
- const char *name;
- int psr_impl, psr_vers, impl, vers;
- int dcache_line_size, dcache_lines, dcache_assoc;
- int icache_line_size, icache_lines, icache_assoc;
- int ecache_line_size, ecache_lines, ecache_assoc;
- int mmu_nctx;
- void (*initfn)(void);
-};
-
-static const struct cpudef sparc_defs[] = {
- {
- .iu_version = 0x00 << 24, /* Impl 0, ver 0 */
- .name = "FMI,MB86900",
- .initfn = bad_cpu_init,
- },
- {
- .iu_version = 0x04 << 24, /* Impl 0, ver 4 */
- .name = "FMI,MB86904",
- .psr_impl = 0,
- .psr_vers = 5,
- .impl = 0,
- .vers = 5,
- .dcache_line_size = 0x10,
- .dcache_lines = 0x200,
- .dcache_assoc = 1,
- .icache_line_size = 0x20,
- .icache_lines = 0x200,
- .icache_assoc = 1,
- .ecache_line_size = 0x20,
- .ecache_lines = 0x4000,
- .ecache_assoc = 1,
- .mmu_nctx = 0x100,
- .initfn = mb86904_init,
- },
- {
- .iu_version = 0x05 << 24, /* Impl 0, ver 5 */
- .name = "FMI,MB86907",
- .psr_impl = 0,
- .psr_vers = 5,
- .impl = 0,
- .vers = 5,
- .dcache_line_size = 0x20,
- .dcache_lines = 0x200,
- .dcache_assoc = 1,
- .icache_line_size = 0x20,
- .icache_lines = 0x200,
- .icache_assoc = 1,
- .ecache_line_size = 0x20,
- .ecache_lines = 0x4000,
- .ecache_assoc = 1,
- .mmu_nctx = 0x100,
- .initfn = mb86904_init,
- },
- {
- .iu_version = 0x10 << 24, /* Impl 1, ver 0 */
- .name = "LSI,L64811",
- .initfn = bad_cpu_init,
- },
- {
- .iu_version = 0x11 << 24, /* Impl 1, ver 1 */
- .name = "CY,CY7C601",
- .psr_impl = 1,
- .psr_vers = 1,
- .impl = 1,
- .vers = 1,
- .mmu_nctx = 0x10,
- .initfn = bad_cpu_init,
- },
- {
- .iu_version = 0x13 << 24, /* Impl 1, ver 3 */
- .name = "CY,CY7C611",
- .initfn = bad_cpu_init,
- },
- {
- .iu_version = 0x40000000,
- .name = "TI,TMS390Z55",
- .psr_impl = 4,
- .psr_vers = 0,
- .impl = 0,
- .vers = 4,
- .dcache_line_size = 0x20,
- .dcache_lines = 0x80,
- .dcache_assoc = 4,
- .icache_line_size = 0x40,
- .icache_lines = 0x40,
- .icache_assoc = 5,
- .ecache_line_size = 0x20,
- .ecache_lines = 0x8000,
- .ecache_assoc = 1,
- .mmu_nctx = 0x10000,
- .initfn = tms390z55_init,
- },
- {
- .iu_version = 0x41000000,
- .name = "TI,TMS390S10",
- .psr_impl = 4,
- .psr_vers = 1,
- .impl = 4,
- .vers = 1,
- .dcache_line_size = 0x10,
- .dcache_lines = 0x80,
- .dcache_assoc = 4,
- .icache_line_size = 0x20,
- .icache_lines = 0x80,
- .icache_assoc = 5,
- .ecache_line_size = 0x20,
- .ecache_lines = 0x8000,
- .ecache_assoc = 1,
- .mmu_nctx = 0x10000,
- .initfn = tms390z55_init,
- },
- {
- .iu_version = 0x42000000,
- .name = "TI,TMS390S10",
- .psr_impl = 4,
- .psr_vers = 2,
- .impl = 4,
- .vers = 2,
- .dcache_line_size = 0x10,
- .dcache_lines = 0x80,
- .dcache_assoc = 4,
- .icache_line_size = 0x20,
- .icache_lines = 0x80,
- .icache_assoc = 5,
- .ecache_line_size = 0x20,
- .ecache_lines = 0x8000,
- .ecache_assoc = 1,
- .mmu_nctx = 0x10000,
- .initfn = tms390z55_init,
- },
- {
- .iu_version = 0x43000000,
- .name = "TI,TMS390S10",
- .psr_impl = 4,
- .psr_vers = 3,
- .impl = 4,
- .vers = 3,
- .dcache_line_size = 0x10,
- .dcache_lines = 0x80,
- .dcache_assoc = 4,
- .icache_line_size = 0x20,
- .icache_lines = 0x80,
- .icache_assoc = 5,
- .ecache_line_size = 0x20,
- .ecache_lines = 0x8000,
- .ecache_assoc = 1,
- .mmu_nctx = 0x10000,
- .initfn = tms390z55_init,
- },
- {
- .iu_version = 0x44000000,
- .name = "TI,TMS390S10",
- .psr_impl = 4,
- .psr_vers = 4,
- .impl = 4,
- .vers = 4,
- .dcache_line_size = 0x10,
- .dcache_lines = 0x80,
- .dcache_assoc = 4,
- .icache_line_size = 0x20,
- .icache_lines = 0x80,
- .icache_assoc = 5,
- .ecache_line_size = 0x20,
- .ecache_lines = 0x8000,
- .ecache_assoc = 1,
- .mmu_nctx = 0x10000,
- .initfn = tms390z55_init,
- },
- {
- .iu_version = 0x1e000000,
- .name = "Ross,RT625",
- .psr_impl = 1,
- .psr_vers = 14,
- .impl = 1,
- .vers = 7,
- .dcache_line_size = 0x20,
- .dcache_lines = 0x80,
- .dcache_assoc = 4,
- .icache_line_size = 0x40,
- .icache_lines = 0x40,
- .icache_assoc = 5,
- .ecache_line_size = 0x20,
- .ecache_lines = 0x8000,
- .ecache_assoc = 1,
- .mmu_nctx = 0x10000,
- .initfn = rt625_init,
- },
- {
- .iu_version = 0x1f000000,
- .name = "Ross,RT620",
- .psr_impl = 1,
- .psr_vers = 15,
- .impl = 1,
- .vers = 7,
- .dcache_line_size = 0x20,
- .dcache_lines = 0x80,
- .dcache_assoc = 4,
- .icache_line_size = 0x40,
- .icache_lines = 0x40,
- .icache_assoc = 5,
- .ecache_line_size = 0x20,
- .ecache_lines = 0x8000,
- .ecache_assoc = 1,
- .mmu_nctx = 0x10000,
- .initfn = rt625_init,
- },
- {
- .iu_version = 0x20000000,
- .name = "BIT,B5010",
- .initfn = bad_cpu_init,
- },
- {
- .iu_version = 0x50000000,
- .name = "MC,MN10501",
- .initfn = bad_cpu_init,
- },
- {
- .iu_version = 0x90 << 24, /* Impl 9, ver 0 */
- .name = "Weitek,W8601",
- .initfn = bad_cpu_init,
- },
- {
- .iu_version = 0xf2000000,
- .name = "GR,LEON2",
- .initfn = bad_cpu_init,
- },
- {
- .iu_version = 0xf3000000,
- .name = "GR,LEON3",
- .initfn = bad_cpu_init,
- },
-};
-
-static const struct cpudef *
-id_cpu(void)
-{
- unsigned long iu_version;
- unsigned int i;
-
- asm("rd %%psr, %0\n"
- : "=r"(iu_version) :);
- iu_version &= 0xff000000;
-
- for (i = 0; i < sizeof(sparc_defs)/sizeof(struct cpudef); i++) {
- if (iu_version == sparc_defs[i].iu_version)
- return &sparc_defs[i];
- }
- printk("Unknown cpu (psr %lx), freezing!\n", iu_version);
- for (;;);
-}
-
static void dummy_mach_init(uint64_t base)
{
}
@@ -543,7 +188,6 @@
const char *banner_name;
const char *model;
const char *name;
- int mid_offset;
void (*initfn)(uint64_t base);
};
@@ -553,7 +197,6 @@
.banner_name = "SPARCstation 5",
.model = "SUNW,501-3059",
.name = "SUNW,SPARCstation-5",
- .mid_offset = 0,
.initfn = ss5_init,
},
{
@@ -561,7 +204,6 @@
.banner_name = "SPARCstation Voyager",
.model = "SUNW,501-2581",
.name = "SUNW,SPARCstation-Voyager",
- .mid_offset = 0,
.initfn = dummy_mach_init,
},
{
@@ -569,7 +211,6 @@
.banner_name = "SPARCstation LX",
.model = "SUNW,501-2031",
.name = "SUNW,SPARCstation-LX",
- .mid_offset = 0,
.initfn = dummy_mach_init,
},
{
@@ -577,7 +218,6 @@
.banner_name = "SPARCstation 4",
.model = "SUNW,501-2572",
.name = "SUNW,SPARCstation-4",
- .mid_offset = 0,
.initfn = ss5_init,
},
{
@@ -585,7 +225,6 @@
.banner_name = "SPARCstation Classic",
.model = "SUNW,501-2326",
.name = "SUNW,SPARCstation-Classic",
- .mid_offset = 0,
.initfn = dummy_mach_init,
},
{
@@ -593,7 +232,6 @@
.banner_name = "Tadpole S3 GX",
.model = "S3",
.name = "Tadpole_S3GX",
- .mid_offset = 0,
.initfn = ss5_init,
},
{
@@ -601,7 +239,6 @@
.banner_name = "SPARCstation 10 (1 X 390Z55)",
.model = "SUNW,S10,501-2365",
.name = "SUNW,SPARCstation-10",
- .mid_offset = 8,
.initfn = ob_eccmemctl_init,
},
{
@@ -609,7 +246,6 @@
.banner_name = "SPARCstation 20 (1 X 390Z55)",
.model = "SUNW,S20,501-2324",
.name = "SUNW,SPARCstation-20",
- .mid_offset = 8,
.initfn = ob_eccmemctl_init,
},
{
@@ -617,7 +253,6 @@
.banner_name = "SPARCsystem 600(1 X 390Z55)",
.model = NULL,
.name = "SUNW,SPARCsystem-600",
- .mid_offset = 8,
.initfn = ob_eccmemctl_init,
},
};
@@ -635,61 +270,16 @@
for (;;);
}
-static void
-ob_nvram_init(uint64_t base, uint64_t offset)
+static void setup_machine(uint64_t base)
{
- unsigned int i;
uint16_t machine_id;
- const struct cpudef *cpu;
const struct machdef *mach;
- char buf[256];
- uint32_t temp;
-
- ob_new_obio_device("eeprom", NULL);
-
- nvram = (unsigned char *)ob_reg(base, offset, NVRAM_SIZE, 1);
-
- PUSH((unsigned long)nvram);
- fword("encode-int");
- push_str("address");
- fword("property");
-
- push_str("mk48t08");
- fword("model");
- fword("finish-device");
-
- fw_cfg_init();
-
- fw_cfg_read(FW_CFG_SIGNATURE, buf, 4);
- buf[4] = '\0';
-
- printk("Configuration device id %s", buf);
-
- temp = fw_cfg_read_i32(FW_CFG_ID);
machine_id = fw_cfg_read_i16(FW_CFG_MACHINE_ID);
+ mach = id_machine(machine_id);
- printk(" version %d machine id %d\n", temp, machine_id);
-
- if (temp != 1) {
- printk("Incompatible configuration device version, freezing\n");
- for(;;);
- }
-
- graphic_depth = fw_cfg_read_i16(FW_CFG_SUN4M_DEPTH);
-
- // Add /idprom
push_str("/");
fword("find-device");
-
- PUSH((long)&nvram[NVRAM_IDPROM]);
- PUSH(32);
- fword("encode-bytes");
- push_str("idprom");
- fword("property");
-
- mach = id_machine(machine_id);
-
push_str(mach->banner_name);
fword("encode-string");
push_str("banner-name");
@@ -707,124 +297,34 @@
fword("property");
mach->initfn(base);
+}
- // Add cpus
- temp = fw_cfg_read_i32(FW_CFG_NB_CPUS);
-
- printk("CPUs: %x", temp);
- cpu = id_cpu();
- printk(" x %s\n", cpu->name);
- for (i = 0; i < temp; i++) {
- push_str("/");
- fword("find-device");
-
- fword("new-device");
-
- push_str(cpu->name);
- fword("device-name");
-
- push_str("cpu");
- fword("device-type");
-
- PUSH(cpu->psr_impl);
- fword("encode-int");
- push_str("psr-implementation");
- fword("property");
-
- PUSH(cpu->psr_vers);
- fword("encode-int");
- push_str("psr-version");
- fword("property");
-
- PUSH(cpu->impl);
- fword("encode-int");
- push_str("implementation");
- fword("property");
-
- PUSH(cpu->vers);
- fword("encode-int");
- push_str("version");
- fword("property");
-
- PUSH(4096);
- fword("encode-int");
- push_str("page-size");
- fword("property");
-
- PUSH(cpu->dcache_line_size);
- fword("encode-int");
- push_str("dcache-line-size");
- fword("property");
-
- PUSH(cpu->dcache_lines);
- fword("encode-int");
- push_str("dcache-nlines");
- fword("property");
-
- PUSH(cpu->dcache_assoc);
- fword("encode-int");
- push_str("dcache-associativity");
- fword("property");
-
- PUSH(cpu->icache_line_size);
- fword("encode-int");
- push_str("icache-line-size");
- fword("property");
-
- PUSH(cpu->icache_lines);
- fword("encode-int");
- push_str("icache-nlines");
- fword("property");
-
- PUSH(cpu->icache_assoc);
- fword("encode-int");
- push_str("icache-associativity");
- fword("property");
-
- PUSH(cpu->ecache_line_size);
- fword("encode-int");
- push_str("ecache-line-size");
- fword("property");
-
- PUSH(cpu->ecache_lines);
- fword("encode-int");
- push_str("ecache-nlines");
- fword("property");
-
- PUSH(cpu->ecache_assoc);
- fword("encode-int");
- push_str("ecache-associativity");
- fword("property");
-
- PUSH(2);
- fword("encode-int");
- push_str("ncaches");
- fword("property");
+static void
+ob_nvram_init(uint64_t base, uint64_t offset)
+{
+ ob_new_obio_device("eeprom", NULL);
- PUSH(cpu->mmu_nctx);
- fword("encode-int");
- push_str("mmu-nctx");
- fword("property");
+ nvram = (unsigned char *)ob_reg(base, offset, NVRAM_SIZE, 1);
- PUSH(8);
- fword("encode-int");
- push_str("sparc-version");
- fword("property");
+ PUSH((unsigned long)nvram);
+ fword("encode-int");
+ push_str("address");
+ fword("property");
- push_str("");
- fword("encode-string");
- push_str("cache-coherence?");
- fword("property");
+ push_str("mk48t08");
+ fword("model");
- PUSH(i + mach->mid_offset);
- fword("encode-int");
- push_str("mid");
- fword("property");
+ fword("finish-device");
- cpu->initfn();
+ // Add /idprom
+ push_str("/");
+ fword("find-device");
- fword("finish-device");
- }
+ PUSH((long)&nvram[NVRAM_IDPROM]);
+ PUSH(32);
+ fword("encode-bytes");
+ push_str("idprom");
+ fword("property");
}
static void
@@ -1132,6 +632,8 @@
#endif
ob_set_obio_ranges(slavio_base);
+ setup_machine(slavio_base);
+
// Zilog Z8530 serial ports, see http://www.zilog.com
// Must be before zs@0,0 or Linux won't boot
ob_zs_init(slavio_base, SLAVIO_ZS1, ZS_INTR, 0, 0);
Modified: trunk/openbios-devel/drivers/obio.h
==============================================================================
--- trunk/openbios-devel/drivers/obio.h Sun Aug 8 22:03:38 2010 (r844)
+++ trunk/openbios-devel/drivers/obio.h Sun Aug 8 23:20:15 2010 (r845)
@@ -38,7 +38,6 @@
#define CFG_ADDR 0xd00000510ULL
#define CFG_SIZE 3
-#define FW_CFG_SUN4M_DEPTH (FW_CFG_ARCH_LOCAL + 0x00)
/* linux/include/asm-sparc/timer.h */
1
0
[commit] r844 - in trunk/openbios-devel: arch/sparc32 drivers include/drivers
by repository service Aug. 8, 2010
by repository service Aug. 8, 2010
Aug. 8, 2010
Author: blueswirl
Date: Sun Aug 8 22:03:38 2010
New Revision: 844
URL: http://tracker.coreboot.org/trac/openbios/changeset/844
Log:
sparc32: move stdio setup to openbios.c
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/arch/sparc32/boot.h
trunk/openbios-devel/arch/sparc32/openbios.c
trunk/openbios-devel/drivers/obio.c
trunk/openbios-devel/include/drivers/drivers.h
Modified: trunk/openbios-devel/arch/sparc32/boot.h
==============================================================================
--- trunk/openbios-devel/arch/sparc32/boot.h Sun Aug 8 21:54:06 2010 (r843)
+++ trunk/openbios-devel/arch/sparc32/boot.h Sun Aug 8 22:03:38 2010 (r844)
@@ -31,6 +31,8 @@
// romvec.c
extern struct linux_arguments_v0 obp_arg;
extern const void *romvec;
+extern const char *obp_stdin_path, *obp_stdout_path;
+extern char obp_stdin, obp_stdout;
// openbios.c
extern int qemu_machine_type;
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Sun Aug 8 21:54:06 2010 (r843)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Sun Aug 8 22:03:38 2010 (r844)
@@ -140,6 +140,65 @@
fword("property");
}
+static void setup_stdio(void)
+{
+ char nographic;
+ const char *stdin, *stdout;
+ phandle_t chosen;
+
+ fw_cfg_read(FW_CFG_NOGRAPHIC, &nographic, 1);
+ if (nographic) {
+ obp_stdin = PROMDEV_TTYA;
+ obp_stdout = PROMDEV_TTYA;
+ stdin = "ttya";
+ stdout = "ttya";
+ } else {
+ obp_stdin = PROMDEV_KBD;
+ obp_stdout = PROMDEV_SCREEN;
+ stdin = "keyboard";
+ stdout = "screen";
+ }
+
+ push_str("/");
+ fword("find-device");
+
+ push_str(stdin);
+ fword("pathres-resolve-aliases");
+ fword("encode-string");
+ push_str("stdin-path");
+ fword("property");
+
+ push_str(stdout);
+ fword("pathres-resolve-aliases");
+ fword("encode-string");
+ push_str("stdout-path");
+ fword("property");
+
+ chosen = find_dev("/chosen");
+ push_str(stdin);
+ fword("open-dev");
+ set_int_property(chosen, "stdin", POP());
+
+ chosen = find_dev("/chosen");
+ push_str(stdout);
+ fword("open-dev");
+ set_int_property(chosen, "stdout", POP());
+
+ push_str(stdin);
+ push_str("input-device");
+ fword("$setenv");
+
+ push_str(stdout);
+ push_str("output-device");
+ fword("$setenv");
+
+ push_str(stdin);
+ fword("input");
+
+ obp_stdin_path = stdin;
+ obp_stdout_path = stdout;
+}
+
static void init_memory(void)
{
memory = malloc(MEMORY_SIZE);
@@ -180,6 +239,7 @@
#endif
device_end();
+ setup_stdio();
/* Initialiase openprom romvec */
romvec = init_openprom();
Modified: trunk/openbios-devel/drivers/obio.c
==============================================================================
--- trunk/openbios-devel/drivers/obio.c Sun Aug 8 21:54:06 2010 (r843)
+++ trunk/openbios-devel/drivers/obio.c Sun Aug 8 22:03:38 2010 (r844)
@@ -638,15 +638,12 @@
static void
ob_nvram_init(uint64_t base, uint64_t offset)
{
- const char *stdin, *stdout;
unsigned int i;
- char nographic;
uint16_t machine_id;
const struct cpudef *cpu;
const struct machdef *mach;
char buf[256];
uint32_t temp;
- phandle_t chosen;
ob_new_obio_device("eeprom", NULL);
@@ -679,7 +676,6 @@
for(;;);
}
- fw_cfg_read(FW_CFG_NOGRAPHIC, &nographic, 1);
graphic_depth = fw_cfg_read_i16(FW_CFG_SUN4M_DEPTH);
// Add /idprom
@@ -829,57 +825,6 @@
fword("finish-device");
}
-
- if (nographic) {
- obp_stdin = PROMDEV_TTYA;
- obp_stdout = PROMDEV_TTYA;
- stdin = "ttya";
- stdout = "ttya";
- } else {
- obp_stdin = PROMDEV_KBD;
- obp_stdout = PROMDEV_SCREEN;
- stdin = "keyboard";
- stdout = "screen";
- }
-
- push_str("/");
- fword("find-device");
-
- push_str(stdin);
- fword("pathres-resolve-aliases");
- fword("encode-string");
- push_str("stdin-path");
- fword("property");
-
- push_str(stdout);
- fword("pathres-resolve-aliases");
- fword("encode-string");
- push_str("stdout-path");
- fword("property");
-
- chosen = find_dev("/chosen");
- push_str(stdin);
- fword("open-dev");
- set_int_property(chosen, "stdin", POP());
-
- chosen = find_dev("/chosen");
- push_str(stdout);
- fword("open-dev");
- set_int_property(chosen, "stdout", POP());
-
- push_str(stdin);
- push_str("input-device");
- fword("$setenv");
-
- push_str(stdout);
- push_str("output-device");
- fword("$setenv");
-
- push_str(stdin);
- fword("input");
-
- obp_stdin_path = stdin;
- obp_stdout_path = stdout;
}
static void
Modified: trunk/openbios-devel/include/drivers/drivers.h
==============================================================================
--- trunk/openbios-devel/include/drivers/drivers.h Sun Aug 8 21:54:06 2010 (r843)
+++ trunk/openbios-devel/include/drivers/drivers.h Sun Aug 8 22:03:38 2010 (r844)
@@ -84,10 +84,6 @@
unsigned long ob_reg(uint64_t base, uint64_t offset, unsigned long size, int map);
void ob_intr(int intr);
-/* arch/sparc32/romvec.c */
-extern const char *obp_stdin_path, *obp_stdout_path;
-extern char obp_stdin, obp_stdout;
-
/* arch/sparc32/boot.c */
extern uint32_t kernel_image;
extern uint32_t kernel_size;
1
0
Aug. 8, 2010
Author: blueswirl
Date: Sun Aug 8 21:54:06 2010
New Revision: 843
URL: http://tracker.coreboot.org/trac/openbios/changeset/843
Log:
sparc32: move /uuid property setup to openbios.c
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/arch/sparc32/openbios.c
trunk/openbios-devel/drivers/obio.c
Modified: trunk/openbios-devel/arch/sparc32/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/sparc32/openbios.c Sun Aug 8 20:50:22 2010 (r842)
+++ trunk/openbios-devel/arch/sparc32/openbios.c Sun Aug 8 21:54:06 2010 (r843)
@@ -27,6 +27,7 @@
#define MEMORY_SIZE (128*1024) /* 16K ram for hosted system */
#define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */
+#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
static ucell *memory;
@@ -116,6 +117,29 @@
{
}
+/* Add /uuid */
+static void setup_uuid(void)
+{
+ static uint8_t qemu_uuid[16];
+
+ fw_cfg_read(FW_CFG_UUID, (char *)qemu_uuid, 16);
+
+ printk("UUID: " UUID_FMT "\n", qemu_uuid[0], qemu_uuid[1], qemu_uuid[2],
+ qemu_uuid[3], qemu_uuid[4], qemu_uuid[5], qemu_uuid[6],
+ qemu_uuid[7], qemu_uuid[8], qemu_uuid[9], qemu_uuid[10],
+ qemu_uuid[11], qemu_uuid[12], qemu_uuid[13], qemu_uuid[14],
+ qemu_uuid[15]);
+
+ push_str("/");
+ fword("find-device");
+
+ PUSH((long)&qemu_uuid);
+ PUSH(16);
+ fword("encode-bytes");
+ push_str("uuid");
+ fword("property");
+}
+
static void init_memory(void)
{
memory = malloc(MEMORY_SIZE);
@@ -208,6 +232,8 @@
bind_func("platform-boot", boot );
bind_func("(go)", go );
+
+ setup_uuid();
}
int openbios(void)
Modified: trunk/openbios-devel/drivers/obio.c
==============================================================================
--- trunk/openbios-devel/drivers/obio.c Sun Aug 8 20:50:22 2010 (r842)
+++ trunk/openbios-devel/drivers/obio.c Sun Aug 8 21:54:06 2010 (r843)
@@ -24,8 +24,6 @@
#include "arch/common/fw_cfg.h"
#include "escc.h"
-#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
-
#define PROMDEV_KBD 0 /* input from keyboard */
#define PROMDEV_SCREEN 0 /* output to screen */
#define PROMDEV_TTYA 1 /* in/out to ttya */
@@ -637,8 +635,6 @@
for (;;);
}
-static uint8_t qemu_uuid[16];
-
static void
ob_nvram_init(uint64_t base, uint64_t offset)
{
@@ -686,24 +682,6 @@
fw_cfg_read(FW_CFG_NOGRAPHIC, &nographic, 1);
graphic_depth = fw_cfg_read_i16(FW_CFG_SUN4M_DEPTH);
- // Add /uuid
- fw_cfg_read(FW_CFG_UUID, (char *)qemu_uuid, 16);
-
- printk("UUID: " UUID_FMT "\n", qemu_uuid[0], qemu_uuid[1], qemu_uuid[2],
- qemu_uuid[3], qemu_uuid[4], qemu_uuid[5], qemu_uuid[6],
- qemu_uuid[7], qemu_uuid[8], qemu_uuid[9], qemu_uuid[10],
- qemu_uuid[11], qemu_uuid[12], qemu_uuid[13], qemu_uuid[14],
- qemu_uuid[15]);
-
- push_str("/");
- fword("find-device");
-
- PUSH((long)&qemu_uuid);
- PUSH(16);
- fword("encode-bytes");
- push_str("uuid");
- fword("property");
-
// Add /idprom
push_str("/");
fword("find-device");
1
0
[commit] r842 - in trunk/openbios-devel/fs: ext2 grubfs hfs hfsplus iso9660
by repository service Aug. 8, 2010
by repository service Aug. 8, 2010
Aug. 8, 2010
Author: blueswirl
Date: Sun Aug 8 20:50:22 2010
New Revision: 842
URL: http://tracker.coreboot.org/trac/openbios/changeset/842
Log:
Add checks for open_ih() return value
Signed-off-by: Blue Swirl <blauwirbel(a)gmail.com>
Modified:
trunk/openbios-devel/fs/ext2/ext2_fs.c
trunk/openbios-devel/fs/grubfs/grubfs_fs.c
trunk/openbios-devel/fs/hfs/hfs_fs.c
trunk/openbios-devel/fs/hfsplus/hfsp_fs.c
trunk/openbios-devel/fs/iso9660/iso9660_fs.c
Modified: trunk/openbios-devel/fs/ext2/ext2_fs.c
==============================================================================
--- trunk/openbios-devel/fs/ext2/ext2_fs.c Sun Aug 8 20:28:48 2010 (r841)
+++ trunk/openbios-devel/fs/ext2/ext2_fs.c Sun Aug 8 20:50:22 2010 (r842)
@@ -267,10 +267,14 @@
int fd, ret = 0;
fd = open_ih(ih);
- if (ext2_probe(fd, offs))
- ret = -1;
-
- close_io(fd);
+ if (fd >= 0) {
+ if (ext2_probe(fd, offs)) {
+ ret = -1;
+ }
+ close_io(fd);
+ } else {
+ ret = -1;
+ }
RET (ret);
}
Modified: trunk/openbios-devel/fs/grubfs/grubfs_fs.c
==============================================================================
--- trunk/openbios-devel/fs/grubfs/grubfs_fs.c Sun Aug 8 20:28:48 2010 (r841)
+++ trunk/openbios-devel/fs/grubfs/grubfs_fs.c Sun Aug 8 20:50:22 2010 (r842)
@@ -336,6 +336,9 @@
int i;
curfs->dev_fd = open_ih(ih);
+ if (curfs->dev_fd == -1) {
+ RET( -1 );
+ }
curfs->offset = offs;
for (i = 0; i < sizeof(fsys_table)/sizeof(fsys_table[0]); i++) {
Modified: trunk/openbios-devel/fs/hfs/hfs_fs.c
==============================================================================
--- trunk/openbios-devel/fs/hfs/hfs_fs.c Sun Aug 8 20:28:48 2010 (r841)
+++ trunk/openbios-devel/fs/hfs/hfs_fs.c Sun Aug 8 20:50:22 2010 (r842)
@@ -479,8 +479,12 @@
char *volname = malloc(VOLNAME_SIZE);
fd = open_ih(my_self());
- get_hfs_vol_name(fd, volname, VOLNAME_SIZE);
- close_io(fd);
+ if (fd >= 0) {
+ get_hfs_vol_name(fd, volname, VOLNAME_SIZE);
+ close_io(fd);
+ } else {
+ volname[0] = '\0';
+ }
PUSH ((ucell)volname);
}
@@ -546,10 +550,14 @@
int fd, ret = 0;
fd = open_ih(ih);
- if (hfs_probe(fd, offs))
- ret = -1;
-
- close_io(fd);
+ if (fd >= 0) {
+ if (hfs_probe(fd, offs)) {
+ ret = -1;
+ }
+ close_io(fd);
+ } else {
+ ret = -1;
+ }
RET (ret);
}
Modified: trunk/openbios-devel/fs/hfsplus/hfsp_fs.c
==============================================================================
--- trunk/openbios-devel/fs/hfsplus/hfsp_fs.c Sun Aug 8 20:28:48 2010 (r841)
+++ trunk/openbios-devel/fs/hfsplus/hfsp_fs.c Sun Aug 8 20:50:22 2010 (r842)
@@ -427,8 +427,12 @@
char *volname = malloc(VOLNAME_SIZE);
fd = open_ih(my_self());
- get_hfs_vol_name(fd, volname, VOLNAME_SIZE);
- close_io(fd);
+ if (fd >= 0) {
+ get_hfs_vol_name(fd, volname, VOLNAME_SIZE);
+ close_io(fd);
+ } else {
+ volname[0] = '\0';
+ }
PUSH ((ucell)volname);
}
@@ -452,10 +456,14 @@
int fd, ret = 0;
fd = open_ih(ih);
- if (volume_probe(fd, offs))
- ret = -1;
-
- close_io(fd);
+ if (fd >= 0) {
+ if (volume_probe(fd, offs)) {
+ ret = -1;
+ }
+ close_io(fd);
+ } else {
+ ret = -1;
+ }
RET (ret);
}
Modified: trunk/openbios-devel/fs/iso9660/iso9660_fs.c
==============================================================================
--- trunk/openbios-devel/fs/iso9660/iso9660_fs.c Sun Aug 8 20:28:48 2010 (r841)
+++ trunk/openbios-devel/fs/iso9660/iso9660_fs.c Sun Aug 8 20:50:22 2010 (r842)
@@ -219,10 +219,14 @@
int fd, ret = 0;
fd = open_ih(ih);
- if (iso9660_probe(fd, offs))
- ret = -1;
-
- close_io(fd);
+ if (fd >= 0) {
+ if (iso9660_probe(fd, offs)) {
+ ret = -1;
+ }
+ close_io(fd);
+ } else {
+ ret = -1;
+ }
RET (ret);
}
1
0