-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from pratik-prajapati-imgtec/add_build_cmds_in_…
…readme Add pistachio soc support
- Loading branch information
Showing
99 changed files
with
10,315 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Using u-boot on Creator (Ci40) Marduk platform | ||
|
||
### How to build/cross-compile for Ci40: | ||
|
||
$ export CROSS_COMPILE=/path/to/mips-toolchain/mips-toolchain-prefix | ||
$ make pistachio_marduk_defconfig | ||
$ make | ||
|
||
This will generate u-boot-pistachio-nor.img | ||
|
||
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. | ||
|
||
### How to flash on Ci40: | ||
|
||
1. [Load OpenWrt](https://github.com/IMGCreator/openwrt/blob/master-pistachio/README.md) | ||
|
||
2. Erase and write u-boot image on bootloader partition of Ci40 | ||
|
||
$ flashcp -v u-boot-pistachio-nor.img /dev/mtd0 | ||
|
||
Note: flashcp needs to be manually selected in OpneWrt menuconfig | ||
|
||
Base system -> busybox -> Cutomize busybox options -> Miscellaneous Utilities -> flashcp | ||
|
||
3. Reboot | ||
|
||
$ reboot | ||
|
||
_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._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
* Copyright (C) 2015 Imagination Technologies | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
|
||
#include <asm/mipsregs.h> | ||
#include <asm/mmu.h> | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/sizes.h> | ||
|
||
#include <common.h> | ||
|
||
#define MIN_PAGE_SIZE SZ_4K | ||
|
||
static int add_wired_tlb_entry(u32 entrylo0, u32 entrylo1, | ||
u32 entryhi, u32 pgsize) | ||
{ | ||
u32 tlbindex; | ||
|
||
tlbindex = read_c0_wired(); | ||
if (tlbindex >= get_tlb_size() || tlbindex >= C0_WIRED_MASK) { | ||
return -1; | ||
} | ||
write_c0_wired(tlbindex + 1); | ||
write_c0_index(tlbindex); | ||
write_c0_pagemask(((pgsize / MIN_PAGE_SIZE) - 1) << C0_PAGEMASK_SHIFT); | ||
write_c0_entryhi(entryhi); | ||
write_c0_entrylo0(entrylo0); | ||
write_c0_entrylo1(entrylo1); | ||
mtc0_tlbw_hazard(); | ||
tlb_write_indexed(); | ||
tlbw_use_hazard(); | ||
|
||
return 0; | ||
} | ||
|
||
static u32 pick_pagesize(u32 start, u32 len) | ||
{ | ||
u32 pgsize, max_pgsize; | ||
|
||
max_pgsize = get_max_pagesize(); | ||
for (pgsize = max_pgsize; | ||
pgsize >= MIN_PAGE_SIZE; | ||
pgsize = pgsize / 4) { | ||
/* | ||
* Each TLB entry maps a pair of virtual pages. To avoid | ||
* aliasing, pick the largest page size that is at most | ||
* half the size of the region we're trying to map. | ||
*/ | ||
if (IS_ALIGNED(start, 2 * pgsize) && (2 * pgsize <= len)) | ||
break; | ||
} | ||
|
||
return pgsize; | ||
} | ||
|
||
/* | ||
* Identity map the memory from [start,start+len] in the TLB using the | ||
* largest suitable page size so as to conserve TLB entries. | ||
*/ | ||
int identity_map(u32 start, size_t len, u32 coherency) | ||
{ | ||
u32 pgsize, pfn, entryhi, entrylo0, entrylo1; | ||
|
||
coherency &= C0_ENTRYLO_COHERENCY_MASK; | ||
while (len > 0) { | ||
pgsize = pick_pagesize(start, len); | ||
entryhi = start; | ||
pfn = start >> 12; | ||
entrylo0 = (pfn << C0_ENTRYLO_PFN_SHIFT) | coherency | | ||
C0_ENTRYLO_D | C0_ENTRYLO_V | C0_ENTRYLO_G; | ||
start += pgsize; | ||
len -= min(len, pgsize); | ||
if (len >= pgsize) { | ||
pfn = start >> 12; | ||
entrylo1 = (pfn << C0_ENTRYLO_PFN_SHIFT) | | ||
coherency | C0_ENTRYLO_D | C0_ENTRYLO_V | | ||
C0_ENTRYLO_G; | ||
start += pgsize; | ||
len -= min(len, pgsize); | ||
} else { | ||
entrylo1 = 0; | ||
} | ||
if (add_wired_tlb_entry(entrylo0, entrylo1, entryhi, pgsize)) | ||
return -1; | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
dtb-$(CONFIG_MACH_PISTACHIO) += pistachio_bub.dtb pistachio_marduk.dtb pistachio_beetle_mbub.dtb pistachio_concerto_mbub.dtb | ||
|
||
targets += $(dtb-y) | ||
|
||
# Add any required device tree compiler flags here | ||
DTC_FLAGS += | ||
|
||
PHONY += dtbs | ||
dtbs: $(addprefix $(obj)/, $(dtb-y)) | ||
@: | ||
|
||
clean-files := *.dtb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../include/dt-bindings |
Oops, something went wrong.