Optimized initrd relocating performance and spi uart output performance
Signed-off-by: Alek Du <alek.du@intel.com>
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 @@
{
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 @@
{
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 @@
/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 @@
/* 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 @@
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 @@
}
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;