Use custom sunxi-tools for the F1C100s
This commit is contained in:
parent
bd882ee3cf
commit
c5cb181546
6 changed files with 206 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/sunxi-tools-f1c100s/Config.in.host"
|
||||||
|
source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/sunxi-tools-f1c100s/Config.in"
|
|
@ -45,4 +45,4 @@ BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
|
||||||
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
|
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
|
||||||
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
|
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
|
||||||
BR2_PACKAGE_HOST_MKPASSWD=y
|
BR2_PACKAGE_HOST_MKPASSWD=y
|
||||||
BR2_PACKAGE_HOST_SUNXI_TOOLS=y
|
BR2_PACKAGE_HOST_SUNXI_TOOLS_F1C100S=y
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
From 5c0a443ba336f10a8db6a99c769aa84ad37ed4d2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vadim Kochan <vadim4j@gmail.com>
|
||||||
|
Date: Wed, 20 Feb 2019 02:48:43 +0200
|
||||||
|
Subject: [PATCH] meminfo: Access to io memory via pointers
|
||||||
|
|
||||||
|
The main reason for this is to be able compile with musl library,
|
||||||
|
because there is no support of inx/outx functions for ARM platform.
|
||||||
|
|
||||||
|
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
|
||||||
|
---
|
||||||
|
meminfo.c | 11 ++++++-----
|
||||||
|
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/meminfo.c b/meminfo.c
|
||||||
|
index 0b0ff23..7d9f10f 100644
|
||||||
|
--- a/meminfo.c
|
||||||
|
+++ b/meminfo.c
|
||||||
|
@@ -22,7 +22,6 @@
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <errno.h>
|
||||||
|
-#include <sys/io.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
@@ -74,24 +73,26 @@ static enum sunxi_soc_version soc_version;
|
||||||
|
unsigned int
|
||||||
|
sunxi_io_read(void *base, int offset)
|
||||||
|
{
|
||||||
|
- return inl((unsigned long) (base + offset));
|
||||||
|
+ unsigned long port = (unsigned long) (base + offset);
|
||||||
|
+ return *((volatile unsigned long *) port);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sunxi_io_write(void *base, int offset, unsigned int value)
|
||||||
|
{
|
||||||
|
- outl(value, (unsigned long) (base + offset));
|
||||||
|
+ unsigned long port = (unsigned long) (base + offset);
|
||||||
|
+ *((volatile unsigned long *) port) = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
sunxi_io_mask(void *base, int offset, unsigned int value, unsigned int mask)
|
||||||
|
{
|
||||||
|
- unsigned int tmp = inl((unsigned long) (base + offset));
|
||||||
|
+ unsigned int tmp = sunxi_io_read(base, offset);
|
||||||
|
|
||||||
|
tmp &= ~mask;
|
||||||
|
tmp |= value & mask;
|
||||||
|
|
||||||
|
- outl(tmp, (unsigned long) (base + offset));
|
||||||
|
+ sunxi_io_write(base, offset, tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
2.14.1
|
||||||
|
|
69
package/sunxi-tools-f1c100s/Config.in
Normal file
69
package/sunxi-tools-f1c100s/Config.in
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
config BR2_PACKAGE_SUNXI_TOOLS_F1C100S
|
||||||
|
bool "sunxi-tools for F1C100s"
|
||||||
|
depends on BR2_arm
|
||||||
|
help
|
||||||
|
Tools for Allwinner A10 (aka sun4i) and A13 (aka sun5i)
|
||||||
|
and suniv based devices.
|
||||||
|
|
||||||
|
http://linux-sunxi.org/Sunxi-tools
|
||||||
|
|
||||||
|
if BR2_PACKAGE_SUNXI_TOOLS_F1C100S
|
||||||
|
|
||||||
|
config BR2_PACKAGE_SUNXI_TOOLS_F1C100S_FEXC
|
||||||
|
bool "sunxi-fexc (fex2bin & bin2fex)"
|
||||||
|
help
|
||||||
|
Convert between .fex board definition files and binary
|
||||||
|
format. These tools are specific for the linux-sunxi kernel
|
||||||
|
and do not apply to the mainline Linux kernel version.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_SUNXI_TOOLS_F1C100S_BOOTINFO
|
||||||
|
bool "sunxi-bootinfo"
|
||||||
|
help
|
||||||
|
Displays information about sunxi boot code.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_SUNXI_TOOLS_F1C100S_FEL
|
||||||
|
bool "sunxi-fel"
|
||||||
|
depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
|
||||||
|
select BR2_PACKAGE_LIBUSB
|
||||||
|
help
|
||||||
|
The sunxi-fel command can interact with a sunxi device in
|
||||||
|
fel mode. This allows do download code to memory and execute
|
||||||
|
it.
|
||||||
|
|
||||||
|
comment "sunxi-fel needs a toolchain w/ threads"
|
||||||
|
depends on !BR2_TOOLCHAIN_HAS_THREADS
|
||||||
|
|
||||||
|
config BR2_PACKAGE_SUNXI_TOOLS_F1C100S_NAND_PART
|
||||||
|
bool "sunxi-nand-part"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
The sunxi-nand-part command allows to repartition the internal
|
||||||
|
NAND on sunxi devices.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_SUNXI_TOOLS_F1C100S_PIO
|
||||||
|
bool "sunxi-pio"
|
||||||
|
help
|
||||||
|
GPIO manipulation tool for sunxi boards.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_SUNXI_TOOLS_F1C100S_MEMINFO
|
||||||
|
bool "sunxi-meminfo"
|
||||||
|
help
|
||||||
|
Utility to retrieve DRAM information from registers on
|
||||||
|
Allwinner SoCs. Specific for the linux-sunxi kernel - does
|
||||||
|
not apply to the mainline Linux kernel version.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_SUNXI_TOOLS_F1C100S_PHOENIX_INFO
|
||||||
|
bool "phoenix_info"
|
||||||
|
help
|
||||||
|
Display information about self-installing SD card images
|
||||||
|
(created with Phoenix Card).
|
||||||
|
|
||||||
|
https://linux-sunxi.org/PhoenixCard
|
||||||
|
|
||||||
|
config BR2_PACKAGE_SUNXI_TOOLS_F1C100S_NAND_IMAGE_BUILDER
|
||||||
|
bool "sunxi-nand-image-builder"
|
||||||
|
help
|
||||||
|
Creates a raw NAND image that can be read by the sunxi NAND
|
||||||
|
controller.
|
||||||
|
|
||||||
|
endif # BR2_PACKAGE_SUNXI_TOOLS_F1C100S
|
12
package/sunxi-tools-f1c100s/Config.in.host
Normal file
12
package/sunxi-tools-f1c100s/Config.in.host
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
config BR2_PACKAGE_HOST_SUNXI_TOOLS_F1C100S
|
||||||
|
bool "host sunxi-tools for F1C100s"
|
||||||
|
depends on BR2_arm
|
||||||
|
help
|
||||||
|
Tools for Allwinner A10 (aka sun4i) and A13 (aka sun5i)
|
||||||
|
based devices. This includes fex2bin which can be used to
|
||||||
|
compile .fex board definition files to the binary script.bin
|
||||||
|
format required by the linux-sunxi kernel. These tools are
|
||||||
|
specific for linux-sunxi kernel and do not apply to the
|
||||||
|
mainline Linux kernel version.
|
||||||
|
|
||||||
|
http://linux-sunxi.org/Sunxi-tools
|
63
package/sunxi-tools-f1c100s/sunxi-tools-f1c100s.mk
Normal file
63
package/sunxi-tools-f1c100s/sunxi-tools-f1c100s.mk
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# sunxi-tools
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
SUNXI_TOOLS_F1C100S_VERSION = 6dac68fbcaaefe61eb6cad78098416812d9d70fc
|
||||||
|
SUNXI_TOOLS_F1C100S_SITE = $(call github,thirtythreeforty,sunxi-tools,$(SUNXI_TOOLS_F1C100S_VERSION))
|
||||||
|
SUNXI_TOOLS_F1C100S_LICENSE = GPL-2.0+
|
||||||
|
SUNXI_TOOLS_F1C100S_LICENSE_FILES = LICENSE.md
|
||||||
|
HOST_SUNXI_TOOLS_F1C100S_DEPENDENCIES = host-libusb host-pkgconf
|
||||||
|
FEX2BIN = $(HOST_DIR)/bin/fex2bin
|
||||||
|
|
||||||
|
SUNXI_TOOLS_F1C100S_TARGETS_$(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_FEXC) += sunxi-fexc
|
||||||
|
SUNXI_TOOLS_F1C100S_TARGETS_$(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_BOOTINFO) += sunxi-bootinfo
|
||||||
|
SUNXI_TOOLS_F1C100S_TARGETS_$(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_FEL) += sunxi-fel
|
||||||
|
SUNXI_TOOLS_F1C100S_TARGETS_$(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_NAND_PART) += sunxi-nand-part
|
||||||
|
SUNXI_TOOLS_F1C100S_TARGETS_$(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_PIO) += sunxi-pio
|
||||||
|
SUNXI_TOOLS_F1C100S_TARGETS_$(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_MEMINFO) += sunxi-meminfo
|
||||||
|
SUNXI_TOOLS_F1C100S_TARGETS_$(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_PHOENIX_INFO) += phoenix_info
|
||||||
|
SUNXI_TOOLS_F1C100S_TARGETS_$(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_NAND_IMAGE_BUILDER) += \
|
||||||
|
sunxi-nand-image-builder
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_FEXC),y)
|
||||||
|
SUNXI_TOOLS_F1C100S_FEXC_LINKS += fex2bin bin2fex
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_SUNXI_TOOLS_F1C100S_FEL),y)
|
||||||
|
SUNXI_TOOLS_F1C100S_DEPENDENCIES += libusb host-pkgconf
|
||||||
|
endif
|
||||||
|
|
||||||
|
define HOST_SUNXI_TOOLS_F1C100S_BUILD_CMDS
|
||||||
|
$(HOST_MAKE_ENV) $(MAKE) CROSS_COMPILE="" CC="$(HOSTCC)" \
|
||||||
|
PREFIX=$(HOST_DIR) EXTRA_CFLAGS="$(HOST_CFLAGS)" \
|
||||||
|
LDFLAGS="$(HOST_LDFLAGS)" -C $(@D) tools misc
|
||||||
|
endef
|
||||||
|
|
||||||
|
define HOST_SUNXI_TOOLS_F1C100S_INSTALL_CMDS
|
||||||
|
$(HOST_MAKE_ENV) $(MAKE) CROSS_COMPILE="" CC="$(HOSTCC)" \
|
||||||
|
PREFIX=$(HOST_DIR) EXTRA_CFLAGS="$(HOST_CFLAGS)" \
|
||||||
|
LDFLAGS="$(HOST_LDFLAGS)" -C $(@D) install-tools install-misc
|
||||||
|
endef
|
||||||
|
|
||||||
|
define SUNXI_TOOLS_F1C100S_BUILD_CMDS
|
||||||
|
$(foreach t,$(SUNXI_TOOLS_F1C100S_TARGETS_y), \
|
||||||
|
$(TARGET_MAKE_ENV) $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||||
|
CC="$(TARGET_CC)" PREFIX=/usr \
|
||||||
|
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
|
LDFLAGS="$(TARGET_LDFLAGS)" -C $(@D) $(t)
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define SUNXI_TOOLS_F1C100S_INSTALL_TARGET_CMDS
|
||||||
|
$(foreach t,$(SUNXI_TOOLS_F1C100S_TARGETS_y), \
|
||||||
|
$(INSTALL) -D -m 0755 $(@D)/$(t) $(TARGET_DIR)/usr/bin/$(t)
|
||||||
|
)
|
||||||
|
$(foreach t,$(SUNXI_TOOLS_F1C100S_FEXC_LINKS), \
|
||||||
|
ln -nfs sunxi-fexc $(TARGET_DIR)/usr/bin/$(t)
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(generic-package))
|
||||||
|
$(eval $(host-generic-package))
|
Loading…
Reference in a new issue