Flash bitstream + BIOS + splash screen
authorlekernel <sebastien.bourdeauducq@lekernel.net>
Thu, 24 Jun 2010 20:28:32 +0000 (22:28 +0200)
committerlekernel <sebastien.bourdeauducq@lekernel.net>
Thu, 24 Jun 2010 20:28:32 +0000 (22:28 +0200)
boards/milkymist-one/flash/Makefile
boards/milkymist-one/flash/flash.cmd
boards/milkymist-one/flash/splash.png [new file with mode: 0644]
boards/milkymist-one/rtl/lm32_include.v
software/bios/Makefile
software/bios/linker.ld
software/bios/splash.c
software/bios/splash.png [deleted file]
software/include/hw/flash.h [new file with mode: 0644]

index 95acacd..3186966 100644 (file)
@@ -1,16 +1,29 @@
-all: flash.mcs
+all: bitstream.mcs bios.mcs splash.mcs
 
-flash.mcs:
+bitstream.mcs:
+       make -C ../synthesis -f Makefile.xst
+       promgen -w -p mcs -o bitstream.mcs -s 32768 -u 0x00000000 ../synthesis/build/system.bit -bpi_dc parallel -data_width 16
+
+bios.mcs:
        make -C ../../../software/bios
-       srec_cat -Output flash.mcs -Intel ../../../software/bios/bios_splash.bin -Binary
+       promgen -w -p mcs -o bios.mcs -s 32768 -b -data_file up 0x000C0000 ../../../software/bios/bios.bin -bpi_dc parallel -data_width 16
+
+splash.mcs: splash.raw
+       promgen -w -p mcs -o splash.mcs -s 32768 -b -data_file up 0x000D0000 splash.raw -bpi_dc parallel -data_width 16
+
+splash.raw: splash.png
+       $(MMDIR)/tools/makeraw splash.png
 
 # Run the Xilinx crapware in a separate directory that we can simply rm -rf
 # to get rid of the garbage it puts all over the filesystem.
-flash: flash.mcs
+flash: all
        mkdir -p impact_sucks
        cd impact_sucks && impact -batch ../flash.cmd
 
 clean:
-       rm -rf impact_sucks flash.mcs
+       rm -rf impact_sucks
+       rm -f bitstream.mcs bitstream.prm bitstream.cfi
+       rm -f bios.mcs bios.prm bios.cfi
+       rm -f splash.raw splash.mcs splash.prm splash.cfi
 
 .PHONY: flash clean
index 8da2634..e07aa7b 100644 (file)
@@ -3,6 +3,10 @@ setCable -p auto
 identify -inferir
 identifyMPM
 attachflash -position 1 -bpi "28F256J3F"
-assignfiletoattachedflash -position 1 -file "../flash.mcs"
+assignfiletoattachedflash -position 1 -file "../bitstream.mcs"
 program -p 1 -dataWidth 16 -rs1 NONE -rs0 NONE -bpionly -e
+assignfiletoattachedflash -position 1 -file "../bios.mcs"
+program -p 1 -dataWidth 16 -rs1 NONE -rs0 NONE -bpionly
+assignfiletoattachedflash -position 1 -file "../splash.mcs"
+program -p 1 -dataWidth 16 -rs1 NONE -rs0 NONE -bpionly
 quit
diff --git a/boards/milkymist-one/flash/splash.png b/boards/milkymist-one/flash/splash.png
new file mode 100644 (file)
index 0000000..a308e1e
Binary files /dev/null and b/boards/milkymist-one/flash/splash.png differ
index 982e907..5185878 100644 (file)
@@ -37,8 +37,8 @@
 // Common configuration options
 //
 
-`define CFG_EBA_RESET 32'h0
-`define CFG_DEBA_RESET 32'h0
+`define CFG_EBA_RESET 32'h00180000
+`define CFG_DEBA_RESET 32'h00180000
 
 `define CFG_PL_MULTIPLY_ENABLED
 `define CFG_PL_BARREL_SHIFT_ENABLED
index 52ba29a..ee05690 100644 (file)
@@ -4,7 +4,7 @@ include $(MMDIR)/software/include.mak
 OBJECTS=crt0.o main.o boot.o splash.o
 SEGMENTS=-j .text -j .data -j .rodata
 
-all: bios_splash.bin
+all: bios.bin
 
 %.bin: %.elf
        $(OBJCOPY) $(SEGMENTS) -O binary $< $@
@@ -18,22 +18,13 @@ bios.elf: linker.ld $(OBJECTS)
        $(LD) $(LDFLAGS) -T linker.ld -N -o $@ $(OBJECTS) -L$(MMDIR)/software/libhpdmc -L$(MMDIR)/software/libbase -L$(MMDIR)/software/libnet -lhpdmc -lbase-light -lnet
        chmod -x $@
 
-splash.raw: splash.png
-       $(MMDIR)/tools/makeraw splash.png
-
-bios_padded.bin: bios.bin
-       dd if=bios.bin of=bios_padded.bin bs=65536 conv=sync
-
-bios_splash.bin: bios_padded.bin splash.raw
-       cat bios_padded.bin splash.raw > bios_splash.bin
-
 .PHONY: clean depend bios.elf
 
 depend:
        makedepend -Y -- $(CFLAGS) -- *.c
 
 clean:
-       rm -f *.o bios.elf bios.bin bios_padded.bin splash.raw bios_splash.bin .*~ *~ Makefile.bak
+       rm -f *.o bios.elf bios.bin .*~ *~ Makefile.bak
 
 # DO NOT DELETE
 
@@ -64,4 +55,4 @@ main.o: ../../software/include/hw/hpdmc.h boot.h splash.h
 splash.o: ../../software/include/base/stdio.h
 splash.o: ../../software/include/base/stdlib.h
 splash.o: ../../software/include/hw/vga.h ../../software/include/hw/common.h
-splash.o: splash.h
+splash.o: ../../software/include/hw/flash.h splash.h
index d2345d5..008ccef 100644 (file)
@@ -4,8 +4,8 @@ ENTRY(_start)
 __DYNAMIC = 0;
 
 MEMORY {
-       flash : ORIGIN = 0x00000000, LENGTH = 0x800000   /* 8M */
-       sdram : ORIGIN = 0x42000000, LENGTH = 0x2000000  /* use the upper 32M of the SDRAM */
+       flash : ORIGIN = 0x00180000, LENGTH = 0x20000    /* 128K */
+       sdram : ORIGIN = 0x42000000, LENGTH = 0x2000000
 }
 
 SECTIONS
index cea2153..e7ef975 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <stdio.h>
 #include <hw/vga.h>
+#include <hw/flash.h>
 
 #include "splash.h"
 
@@ -27,7 +28,7 @@ static unsigned short splash_fb[640*480] __attribute__((aligned(32)));;
 void splash_display()
 {
        int i;
-       unsigned short *splash_src = (unsigned short *)65536;
+       unsigned short *splash_src = (unsigned short *)FLASH_OFFSET_SPLASH;
        
        printf("I: Displaying splash screen...");
 
diff --git a/software/bios/splash.png b/software/bios/splash.png
deleted file mode 100644 (file)
index a308e1e..0000000
Binary files a/software/bios/splash.png and /dev/null differ
diff --git a/software/include/hw/flash.h b/software/include/hw/flash.h
new file mode 100644 (file)
index 0000000..62999b7
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Milkymist VJ SoC (Software)
+ * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __HW_FLASH_H
+#define __HW_FLASH_H
+
+#define FLASH_OFFSET_BITSTREAM (0x00000000)
+#define FLASH_OFFSET_BIOS      (0x00180000)
+#define FLASH_OFFSET_SPLASH    (0x001A0000)
+
+#endif /* __HW_FLASH_H */