-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Imagination's Pistachio SoC and (Ci40) Marduk platform support #201
Closed
abhijit-mahajani-imgtec
wants to merge
11
commits into
openwrt:master
from
abhijit-mahajani-imgtec:pistachio-4.4
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
eda22bd
pistachio: add new target for Imagination's Pistachio SoC
1851cdb
image.mk: use LINUX_KARCH rather than ARCH for fit
Ham22 89d936d
pistachio: revert EOF hacks
Ham22 bf42b99
pistachio: add dts
dea9cb2
pistachio: add alias for wifi in dts
e4a1e39
pistachio: add config-4.4
9f52ecd
kernel: add missing symbol for 4.4
francois-berder 4ae17d3
pistachio: add kernel patches for 4.4
2f74077
pistachio: add base-files for Ci40
ae2a3a6
generic/config-4.4: Add missing options
francois-berder dd695fc
uboot-envtools: add pistachio support
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (C) 2016 OpenWrt.org | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
[ -e /etc/config/ubootenv ] && exit 0 | ||
|
||
touch /etc/config/ubootenv | ||
|
||
. /lib/functions/pistachio.sh | ||
. /lib/uboot-envtools.sh | ||
. /lib/functions.sh | ||
|
||
board=$(pistachio_board_name) | ||
|
||
case "$board" in | ||
Marduk) | ||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x1000" "" | ||
;; | ||
esac | ||
|
||
config_load ubootenv | ||
config_foreach ubootenv_add_app_config ubootenv | ||
|
||
exit 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright (C) 2016 OpenWrt.org | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
ARCH:=mipsel | ||
BOARD:=pistachio | ||
BOARDNAME:=IMG MIPS Pistachio | ||
FEATURES:=targz nand squashfs ubifs audio ramdisk fpu usb usbgadget | ||
SUBTARGETS=marduk | ||
|
||
KERNEL_PATCHVER:=4.4 | ||
|
||
CPU_TYPE:=mips32r2 | ||
|
||
include $(INCLUDE_DIR)/target.mk | ||
|
||
define Target/Description | ||
Build firmware images for Pistachio board. | ||
endef | ||
|
||
$(eval $(call BuildTarget)) |
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,7 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
START=99 | ||
|
||
start() { | ||
echo 0 > `ls -1 /sys/devices/platform/*uboot-count/bootcount` | ||
} |
29 changes: 29 additions & 0 deletions
29
target/linux/pistachio/base-files/lib/functions/pistachio.sh
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 @@ | ||
#!/bin/sh | ||
|
||
pistachio_board_detect() { | ||
name=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: IMG \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"` | ||
model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"` | ||
[ -z "$name" ] && name="unknown" | ||
[ -z "$model" ] && model="unknown" | ||
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" | ||
echo $name > /tmp/sysinfo/board_name | ||
echo $model > /tmp/sysinfo/model | ||
} | ||
|
||
pistachio_board_model() { | ||
local model | ||
|
||
[ -f /tmp/sysinfo/model ] && model=$(cat /tmp/sysinfo/model) | ||
[ -z "$model" ] && model="unknown" | ||
|
||
echo "$model" | ||
} | ||
|
||
pistachio_board_name() { | ||
local name | ||
|
||
[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) | ||
[ -z "$name" ] && name="unknown" | ||
|
||
echo "$name" | ||
} |
9 changes: 9 additions & 0 deletions
9
target/linux/pistachio/base-files/lib/preinit/03_preinit_board.sh
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,9 @@ | ||
#!/bin/sh | ||
|
||
do_pistachio() { | ||
. /lib/functions/pistachio.sh | ||
|
||
pistachio_board_detect | ||
} | ||
|
||
boot_hook_add preinit_main do_pistachio |
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,37 @@ | ||
. /lib/functions/pistachio.sh | ||
|
||
platform_check_image() | ||
{ | ||
local board=$(pistachio_board_name) | ||
nand_do_platform_check "$board" "$1" | ||
return $? | ||
} | ||
|
||
platform_pre_upgrade() | ||
{ | ||
export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /usr/sbin/fw_printenv /usr/sbin/fw_setenv" | ||
export RAMFS_COPY_BIN="${RAMFS_COPY_BIN} /bin/mkdir /bin/touch" | ||
export RAMFS_COPY_DATA="${RAMFS_COPY_DATA} /etc/fw_env.config /var/lock/fw_printenv.lock" | ||
} | ||
|
||
platform_do_upgrade() | ||
{ | ||
mkdir -p /var/lock | ||
touch /var/lock/fw_printenv.lock | ||
|
||
boot_partition=`fw_printenv -n boot_partition` | ||
echo "Current boot partiton " $boot_partition | ||
|
||
if [ "$boot_partition" == "1" ] | ||
then | ||
CI_UBIPART="firmware0" | ||
fw_setenv boot_partition 0 | ||
else | ||
CI_UBIPART="firmware1" | ||
fw_setenv boot_partition 1 | ||
fi | ||
|
||
echo "Writing image to " $CI_UBIPART | ||
|
||
nand_upgrade_ubinized $1; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any plans to add more subtargets soon? If not, you should drop this line.