summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlek Du <alek.du@intel.com>2008-07-10 14:46:17 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 20:22:38 -0700
commitc8496d189ca8e443b6a56e66e4069a0dbe694941 (patch)
tree78033b95475e28d63c15593953b42edd3c391d0b
parentc94f74d0d4320cf0469c77dac444bd6ec35b0985 (diff)
downloadbootstub-c8496d189ca8e443b6a56e66e4069a0dbe694941.tar.gz
Added spi uart output suppression flag, fixing some minor bugs
-rw-r--r--Makefile6
-rw-r--r--bootstub.c5
-rw-r--r--bootstub.h1
-rw-r--r--head.S7
-rw-r--r--spi-uart.c5
5 files changed, 15 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 083025e..2e366a1 100644
--- a/Makefile
+++ b/Makefile
@@ -12,13 +12,13 @@ bootstub.elf:bootstub.lds $(OBJ)
ld -m elf_i386 -T bootstub.lds $(OBJ) -o $@
bootstub.o:bootstub.c
- gcc -c bootstub.c
+ gcc -Wall -c bootstub.c
spi-uart.o:spi-uart.c
- gcc -c spi-uart.c
+ gcc -Wall -c spi-uart.c
head.o:head.S
- gcc -c head.S
+ gcc -Wall -c head.S
clean:
rm -rf *.o *.bin *.elf *.bz2 *.rpm
diff --git a/bootstub.c b/bootstub.c
index c0d3f8b..2398af9 100644
--- a/bootstub.c
+++ b/bootstub.c
@@ -20,6 +20,9 @@
#include "types.h"
#include "bootstub.h"
#include "bootparam.h"
+#include "spi-uart.h"
+
+#define bs_printk(x) { if (! *(int *)SPI_UART_SUPPRESSION) bs_spi_printk(x);}
struct gdt_ptr {
u16 len;
@@ -110,7 +113,7 @@ int bootstub(void)
{
setup_idt();
setup_gdt();
- bs_spi_printk("Bootstub Version: 0.1 ...\n");
+ bs_printk("Bootstub Version: 0.1 ...\n");
setup_boot_params((struct boot_params *)BOOT_PARAMS_OFFSET,
(struct setup_header *)SETUP_HEADER_OFFSET);
return get_32bit_entry((unsigned char *)BZIMAGE_OFFSET);
diff --git a/bootstub.h b/bootstub.h
index 2598a5c..53a12bf 100644
--- a/bootstub.h
+++ b/bootstub.h
@@ -7,6 +7,7 @@
#define CMDLINE_OFFSET 0x100000
#define BZIMAGE_SIZE_OFFSET 0x100100
#define INITRD_SIZE_OFFSET 0x100104
+#define SPI_UART_SUPPRESSION 0x100108
#define STACK_OFFSET 0x101000
#define BZIMAGE_OFFSET 0x102000
diff --git a/head.S b/head.S
index 3ff7ae9..3b3731b 100644
--- a/head.S
+++ b/head.S
@@ -35,10 +35,13 @@
* 0x101000 +-----------------------+
* | free space |
* | used as stack |
+ * +-----------------------+
+ * | boot stub spi uart | MIC need to fill it:
+ * | suppression flag | 0x1 suppression, 0x0 default
* 0x100108 +-----------------------+
- * | initrd size | MIC need to fill it according to bzImage size
+ * | initrd size | MIC need to fill it: initrd file size
* 0x100104 +-----------------------+
- * | bzImage size | MIC need to fill it according to initrd size
+ * | bzImage size | MIC need to fill it: bzImage file size
* 0x100100 +-----------------------+
* | kernel cmdline | MIC need to fill it
* 0x100000 +-----------------------+
diff --git a/spi-uart.c b/spi-uart.c
index 94e99c4..55e33eb 100644
--- a/spi-uart.c
+++ b/spi-uart.c
@@ -20,7 +20,7 @@
#include "spi-uart.h"
#define MRST_SPI_TIMEOUT 0x200000
-static spi_inited = 0;
+static int spi_inited = 0;
static struct mrst_spi_reg *pspi = 0;
static void spi_init()
@@ -71,10 +71,9 @@ static void max3110_write_config(void)
}
/* transfer char to a eligibal word and send to max3110 */
-static int max3110_write_data(char c)
+static void max3110_write_data(char c)
{
u16 data;
- u8 config;
data = 0x8000 | c;
pspi->dr[0] = data;