Skip to content

Commit a78dbae

Browse files
Merge pull request #8 from Ham22/extern-build-issues
Extern build issues
2 parents d0483d7 + b42317c commit a78dbae

File tree

3 files changed

+17
-45
lines changed

3 files changed

+17
-45
lines changed

README.md

+11-39
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,17 @@
11
# Using u-boot on Creator (Ci40) Marduk platform
22

3-
### How to build/cross-compile for Ci40:
3+
## Toolchain setup
4+
If you are using the toolchain produced by OpenWrt you must setup the environment as explained
5+
[here](https://wiki.openwrt.org/doc/devel/crosscompile).
46

5-
$ export CROSS_COMPILE=/path/to/mips-toolchain/mips-toolchain-prefix
6-
$ make pistachio_marduk_defconfig
7-
$ make
7+
For the MIPS official toolchain see
8+
[here](https://community.imgtec.com/developers/mips/tools/codescape-mips-sdk/download-codescape-mips-sdk-essentials/).
89

9-
This will generate u-boot-pistachio-nor.img
10-
11-
Note: Using OpenWrt's toolchain toolchain-mipsel_mips32_gcc-5.2.0_musl-1.1.11 will require [this patch](http://lists.denx.de/pipermail/u-boot/2015-July/217911.html) to be applied.
12-
13-
### How to flash on Ci40:
14-
15-
1. [Load OpenWrt](https://github.com/IMGCreator/openwrt/blob/master-pistachio/README.md)
16-
17-
2. Erase and write u-boot image on bootloader partition of Ci40
18-
19-
$ flashcp -v u-boot-pistachio-nor.img /dev/mtd0
20-
21-
Note: flashcp needs to be manually selected in OpneWrt menuconfig
10+
## Configure and build it
11+
$ make CROSS_COMPILE=<toolchain-prefix> pistachio_marduk_defconfig
12+
$ make CROSS_COMPILE=<toolchain-prefix>
2213

23-
Base system -> busybox -> Cutomize busybox options -> Miscellaneous Utilities -> flashcp
24-
25-
3. Reboot
26-
27-
$ reboot
28-
29-
Once restarted the board, you should see the date when you have built the u-boot on the console as follows:
30-
31-
U-Boot SPL 2015.07-rc2 (Jun 14 2016 - 19:20:36)
32-
33-
34-
U-Boot 2015.07-rc2 (Jun 14 2016 - 19:20:36 +0530)
35-
36-
MIPS(interAptiv): IMG Pistachio 546MHz.
37-
Model: IMG Marduk
38-
DRAM: 256 MiB
39-
NAND: 512 MiB
40-
MMC: Synopsys Mobile storage: 0
41-
SF: Detected W25Q16CL with page size 256 Bytes, erase size 4 KiB, total 2 MiB
42-
43-
This means your built u-boot image has been flashed properly on the board!!
14+
This will generate u-boot-pistachio-nor.img
4415

45-
_Please be aware that you may brick the board if you flashed a wrong bootloader. Only way to re-cover back the board is to use Dedi-prog SF100 programmer to flash the pre-built bootloader again._
16+
## Flash it onto your Ci40
17+
See our [docs](https://docs.creatordev.io/ci40/guides/openwrt-platform/#flashing-u-boot-binary).

arch/mips/include/asm/io.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static inline void set_io_port_base(unsigned long base)
117117
* Change virtual addresses to physical addresses and vv.
118118
* These are trivial on the 1:1 Linux/MIPS mapping
119119
*/
120-
extern inline phys_addr_t virt_to_phys(volatile void * address)
120+
static inline phys_addr_t virt_to_phys(volatile void * address)
121121
{
122122
#ifndef CONFIG_64BIT
123123
return CPHYSADDR(address);
@@ -126,7 +126,7 @@ extern inline phys_addr_t virt_to_phys(volatile void * address)
126126
#endif
127127
}
128128

129-
extern inline void * phys_to_virt(unsigned long address)
129+
static inline void * phys_to_virt(unsigned long address)
130130
{
131131
#ifndef CONFIG_64BIT
132132
return (void *)KSEG0ADDR(address);
@@ -560,12 +560,12 @@ static inline void unmap_physmem(void *vaddr, unsigned long flags)
560560

561561
#ifdef CONFIG_PHYS_TO_BUS
562562

563-
extern inline unsigned long phys_to_bus(unsigned long phys)
563+
static inline unsigned long phys_to_bus(unsigned long phys)
564564
{
565565
return (unsigned long) virt_to_phys((void * )phys);
566566
}
567567

568-
extern inline unsigned long bus_to_phys(unsigned long bus)
568+
static inline unsigned long bus_to_phys(unsigned long bus)
569569
{
570570
return (unsigned long) phys_to_virt(bus);
571571
}

include/phys2bus.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#define _BUS_ADDR_H
99

1010
#ifdef CONFIG_PHYS_TO_BUS
11-
unsigned long phys_to_bus(unsigned long phys);
12-
unsigned long bus_to_phys(unsigned long bus);
11+
static unsigned long phys_to_bus(unsigned long phys);
12+
static unsigned long bus_to_phys(unsigned long bus);
1313
#else
1414
static inline unsigned long phys_to_bus(unsigned long phys)
1515
{

0 commit comments

Comments
 (0)