summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlek Du <alek.du@intel.com>2009-05-26 09:56:47 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 20:22:39 -0700
commita24ea5cfb4209b37f8d42f9ed5584ae9cce85bfc (patch)
tree2e04a68f343859772768e5048a4e19787db29da8
parented6e3ccf6103841af4751474b89898296987288d (diff)
downloadbootstub-a24ea5cfb4209b37f8d42f9ed5584ae9cce85bfc.tar.gz
Optimized initrd relocating performance and spi uart output performance
Signed-off-by: Alek Du <alek.du@intel.com>
-rw-r--r--VERSION1
-rw-r--r--bootstub.c19
-rw-r--r--bootstub.spec3
-rw-r--r--spi-uart.c13
4 files changed, 24 insertions, 12 deletions
diff --git a/VERSION b/VERSION
index 443cb07..7b93907 100644
--- a/VERSION
+++ b/VERSION
@@ -1,3 +1,4 @@
+0.6 optimized spi uart and initrd relocation performance. May 26, 2009
0.5 add arch parameter. March 12, 2009
0.4 spi suppression flag. July 19, 2008
0.3 spi on select 0x2. June 17, 2008
diff --git a/bootstub.c b/bootstub.c
index 1b9d1ca..e6f0183 100644
--- a/bootstub.c
+++ b/bootstub.c
@@ -55,16 +55,30 @@ static void *memcpy(void *dest, const void *src, size_t count)
{
char *tmp = dest;
const char *s = src;
+ size_t _count = count / 4;
+ while (_count--) {
+ *(long *)tmp = *(long *)s;
+ tmp += 4;
+ s += 4;
+ }
+ count %= 4;
while (count--)
*tmp++ = *s++;
return dest;
}
-static void *memset(void *s, int c, size_t count)
+static void *memset(void *s, unsigned char c, size_t count)
{
char *xs = s;
+ size_t _count = count / 4;
+ unsigned long _c = c << 24 | c << 16 | c << 8 | c;
+ while (_count--) {
+ *(long *)xs = _c;
+ xs += 4;
+ }
+ count %= 4;
while (count--)
*xs++ = c;
return s;
@@ -114,8 +128,9 @@ int bootstub(void)
{
setup_idt();
setup_gdt();
- bs_printk("Bootstub Version: 0.5 ...\n");
+ bs_printk("Bootstub Version: 0.6 ...\n");
setup_boot_params((struct boot_params *)BOOT_PARAMS_OFFSET,
(struct setup_header *)SETUP_HEADER_OFFSET);
+ bs_printk("Jump to kernel 32bit entry ...\n");
return get_32bit_entry((unsigned char *)BZIMAGE_OFFSET);
}
diff --git a/bootstub.spec b/bootstub.spec
index 143140b..1bc4543 100644
--- a/bootstub.spec
+++ b/bootstub.spec
@@ -28,6 +28,9 @@ install -m 755 bootstub $RPM_BUILD_ROOT/boot/
/boot/bootstub
%changelog
+* Tue May 12 2009 Alek Du <alek.du@intel.com> - 0.6
+- improved initrd relocation performance
+- improved spi uart output performance
* Thu Mar 12 2009 Alek Du <alek.du@intel.com> - 0.5
- add sub arch parameter
* Thu Jul 10 2008 Alek Du <alek.du@intel.com> - 0.4
diff --git a/spi-uart.c b/spi-uart.c
index 42cf8b4..ca6ec25 100644
--- a/spi-uart.c
+++ b/spi-uart.c
@@ -43,7 +43,7 @@ static void spi_init()
/* set a default baud rate, 115200 */
/* feng, need make sure SPIC and MAXIM3110 match */
//spi_enable_clk(32);
- pspi->baudr = 2;
+ pspi->baudr = 0xd8;
/* need set the transmit threshhol? */
/* pspi->txftlr = 0x3; */
@@ -70,20 +70,13 @@ static void max3110_write_config(void)
pspi->dr[0] = config;
}
-static void spi_uart_delay(volatile unsigned int loops)
-{
- while (loops--);
-}
-
/* transfer char to a eligibal word and send to max3110 */
static void max3110_write_data(char c)
{
u16 data;
- spi_uart_delay(0x8000);
data = 0x8000 | c;
pspi->dr[0] = data;
- spi_uart_delay(0x8000);
}
/* slave select should be called in the read/write function */
@@ -107,10 +100,10 @@ static int spi_max3110_putc(char c)
}
timeout = MRST_SPI_TIMEOUT;
- /* early putc need make sure the TX FIFO is empty */
+ /* early putc need make sure the TX FIFO is not full*/
while (timeout--) {
sr = pspi->sr;
- if ( (sr & SR_BUSY) || !(sr & SR_TF_EMPT))
+ if ( (sr & SR_BUSY) || !(sr & SR_TF_NOT_FULL))
continue;
else
break;