Giter Club home page Giter Club logo

jh7100_secondboot's Introduction

Cross Compile

Download compiler according to your enviroment as the below link:

https://github.com/sifive/freedom-tools/releases/tag/v2020.12.0

Add the compiler to your PATH:

export PATH=/home/user/compiler/bin:$PATH

Build

Enter the build directory, generate the bootloader-JH7100-xxxxxx.bin.out file after make

Upgrade

Follow the instruction as the below steps to update the secondboot

Step 1: After the hardware connections(power and serial port), power on the StarLight / VisionFive and you will see the startup information as follows.

bootloader version:211102-0b86f96
ddr 0x00000000, 1M test
ddr 0x00100000, 2M test
DDR clk 2133M,Version: 211102-d086aee
2

Step 2: Press any key as soon as it starts up to enter the upgrade menu. In this menu, you can only update u-boot.

bootloader version:211102-0b86f96
ddr 0x00000000, 1M test
ddr 0x00100000, 2M test
DDR clk 2133M,Version: 211102-d086aee
0
***************************************************
*************** FLASH PROGRAMMING *****************
***************************************************
0:update uboot
1:quit
select the function:

Step 3: Type root@s5t and press Enter to enter the extended version of the upgrade menu. In this menu, you can update u-boot, secondboot and ddrinit.

***************************************************
*************** FLASH PROGRAMMING *****************
***************************************************
0:update uboot
1:quit
select the function: root@s5t
0:update second boot
1:update ddr init boot
2:update uboot
3:quit
select the function:

Step 4: Type 0 and press Enter to update the secondboot. Step 5: Navigate to File > Transfer > XMODEM > Send... and choose the bootloader-xxxx-xxxx.bin.out.

jh7100_secondboot's People

Contributors

cavokz avatar mcd500 avatar michaelzhuxx avatar pdp7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jh7100_secondboot's Issues

Information of a working toolchain needed

I am using a bootlin RISC-V toolchain (GCC 10.2.0, binutils 2.34) to build second boot.

First of all, this toolchain does not support nano specs, and I had to do the following changes otherwise it cannot build.

diff --git a/build/Makefile b/build/Makefile
index ee5fc38..e70a6e8 100755
--- a/build/Makefile
+++ b/build/Makefile
@@ -37,7 +37,7 @@ CFLAGS += -mcmodel=medany
 CFLAGS += $(INCLUDE_DIR)
 CCASFLAGS= -mcmodel=medany -mexplicit-relocs   
                                        
-LDFLAGS = -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI)-T $(LINKER_SCRIPT) -nostartfiles --specs=nano.specs -Wl,-Map,$(MAP_FILE)
+LDFLAGS = -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI)-T $(LINKER_SCRIPT) -nostartfiles -Wl,-Map,$(MAP_FILE)
 
 # object list
 OBJECTLIST=../boot/start.o\

With that, lots of warnings were generated during the build process, like:

In file included from ../spi/cadence_qspi_apb.c:28:
../common/comdef.h:105:51: note: expected ‘volatile void *’ but argument is of type ‘unsigned int’
  105 | static inline void writel(u32 val, volatile void *addr)
      |                                    ~~~~~~~~~~~~~~~^~~~
../spi/cadence_qspi_apb.c:948:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  948 |         (u32)plat->regbase + CQSPI_REG_INDIRECTWR);
      |         ^
../spi/cadence_qspi_apb.c:948:28: warning: passing argument 2 of ‘writel’ makes pointer from integer without a cast [-Wint-conversion]
  948 |         (u32)plat->regbase + CQSPI_REG_INDIRECTWR);
      |                            ^
      |                            |
      |                            unsigned int
In file included from ../spi/cadence_qspi_apb.c:28:

In the end the linker complains:

riscv64-buildroot-linux-gnu/bin/ld: section .rodata LMA [0000000018002200,000000001800237b] overlaps section .plt LMA [00000000180021f0,000000001800221f]
riscv64-buildroot-linux-gnu/bin/ld: section .dynamic LMA [0000000018002380,00000000180024ff] overlaps section .interp LMA [000000001800237c,000000001800239c]
riscv64-buildroot-linux-gnu/bin/ld: section .gnu.version LMA [000000001800239e,00000000180023a1] overlaps section .dynamic LMA [0000000018002380,00000000180024ff]
collect2: error: ld returned 1 exit status

I believe this is due to the reason that this toolchain does not support the nano specs, which is used to generate small footprint images. It seems size is a problem on BeagleV.

Hence the information of a working toolchain is needed.

What is this repo for?

I don't understand what is this repo for. The readme.txt only provides some vague instructions related to build process.

Is this repo containing the source codes of the on-chip boot ROM?

Provide real upgrade instructions

The readme file references a seedstudio web page for instructions on how to upgrade secondboot on a beaglev.
Sadly that page got removed, so right now no upgrade instructions are available.

Please either add them to the readme or point a working source?

Clear 0x7c1 CSR

Now that the BeagleV Starlight board is moving to OpenSBI generic platform, we need to clear 0x7c1 CSR in secondboot or ddrinit while still in m-mode. This improves the performance of the SiFive U74 cores

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.