diff options
author | Alek Du <alek.du@intel.com> | 2008-07-10 14:46:17 +0800 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 20:22:38 -0700 |
commit | c8496d189ca8e443b6a56e66e4069a0dbe694941 (patch) | |
tree | 78033b95475e28d63c15593953b42edd3c391d0b | |
parent | c94f74d0d4320cf0469c77dac444bd6ec35b0985 (diff) | |
download | bootstub-c8496d189ca8e443b6a56e66e4069a0dbe694941.tar.gz |
Added spi uart output suppression flag, fixing some minor bugs
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | bootstub.c | 5 | ||||
-rw-r--r-- | bootstub.h | 1 | ||||
-rw-r--r-- | head.S | 7 | ||||
-rw-r--r-- | spi-uart.c | 5 |
5 files changed, 15 insertions, 9 deletions
@@ -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 @@ -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); @@ -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 @@ -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 +-----------------------+ @@ -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; |