WIP: Add initial support for FriendlyARM Nanopi R2S (#1793)
* Add initial support for FriendlyARM Nanopi R2s One net port not working yet. * Enable 2nd network, rename it to lan0, adjust motd to see lan* * Added rk3328 dmc devfreq driver * Fixed SD card issues for NanoPi R2s * Added usb serial gadget console for NanoPi R2s Co-authored-by: Piotr Szczepanik <piter75@gmail.com>
This commit is contained in:
parent
a4a609abf9
commit
a0e009a73e
10
config/boards/nanopi-r2s.wip
Normal file
10
config/boards/nanopi-r2s.wip
Normal file
@ -0,0 +1,10 @@
|
||||
# RK3328 quad core 1GB 2 x GBE USB2
|
||||
BOARD_NAME="Nanopi R2S"
|
||||
BOARDFAMILY="rockchip64"
|
||||
BOOTCONFIG="rock64-rk3328_defconfig"
|
||||
KERNEL_TARGET="current,dev"
|
||||
DEFAULT_CONSOLE="serial"
|
||||
MODULES_CURRENT="g_serial"
|
||||
SERIALCON="ttyS2:1500000,ttyGS0"
|
||||
BUILD_DESKTOP="no"
|
||||
BOOT_FDT_FILE="rockchip/rk3328-nanopi-r2-rev00.dtb"
|
||||
@ -2514,13 +2514,13 @@ CONFIG_SLIP_COMPRESSED=y
|
||||
CONFIG_SLIP_SMART=y
|
||||
CONFIG_SLIP_MODE_SLIP6=y
|
||||
CONFIG_USB_NET_DRIVERS=y
|
||||
# CONFIG_USB_CATC is not set
|
||||
# CONFIG_USB_KAWETH is not set
|
||||
CONFIG_USB_PEGASUS=y
|
||||
CONFIG_USB_RTL8150=y
|
||||
CONFIG_USB_RTL8152=y
|
||||
# CONFIG_USB_LAN78XX is not set
|
||||
CONFIG_USB_USBNET=y
|
||||
CONFIG_USB_CATC=m
|
||||
CONFIG_USB_KAWETH=m
|
||||
CONFIG_USB_PEGASUS=m
|
||||
CONFIG_USB_RTL8150=m
|
||||
CONFIG_USB_RTL8152=m
|
||||
CONFIG_USB_LAN78XX=m
|
||||
CONFIG_USB_USBNET=m
|
||||
CONFIG_USB_NET_AX8817X=m
|
||||
CONFIG_USB_NET_AX88179_178A=m
|
||||
CONFIG_USB_NET_CDCETHER=m
|
||||
@ -2530,13 +2530,13 @@ CONFIG_USB_NET_CDC_NCM=m
|
||||
# CONFIG_USB_NET_CDC_MBIM is not set
|
||||
CONFIG_USB_NET_DM9601=y
|
||||
# CONFIG_USB_NET_SR9700 is not set
|
||||
CONFIG_USB_NET_SR9800=y
|
||||
CONFIG_USB_NET_SMSC75XX=y
|
||||
CONFIG_USB_NET_SMSC95XX=y
|
||||
# CONFIG_USB_NET_GL620A is not set
|
||||
CONFIG_USB_NET_SR9800=m
|
||||
CONFIG_USB_NET_SMSC75XX=m
|
||||
CONFIG_USB_NET_SMSC95XX=m
|
||||
CONFIG_USB_NET_GL620A=m
|
||||
CONFIG_USB_NET_NET1080=m
|
||||
CONFIG_USB_NET_PLUSB=y
|
||||
CONFIG_USB_NET_MCS7830=y
|
||||
CONFIG_USB_NET_PLUSB=m
|
||||
CONFIG_USB_NET_MCS7830=m
|
||||
CONFIG_USB_NET_RNDIS_HOST=m
|
||||
CONFIG_USB_NET_CDC_SUBSET_ENABLE=m
|
||||
CONFIG_USB_NET_CDC_SUBSET=m
|
||||
@ -5343,12 +5343,11 @@ CONFIG_USB_ULPI_VIEWPORT=y
|
||||
# end of USB Physical Layer drivers
|
||||
|
||||
CONFIG_USB_GADGET=y
|
||||
# CONFIG_USB_GADGET_DEBUG is not set
|
||||
# CONFIG_USB_GADGET_DEBUG_FILES is not set
|
||||
# CONFIG_USB_GADGET_DEBUG_FS is not set
|
||||
CONFIG_USB_GADGET_VBUS_DRAW=2
|
||||
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
|
||||
# CONFIG_U_SERIAL_CONSOLE is not set
|
||||
CONFIG_U_SERIAL_CONSOLE=y
|
||||
|
||||
#
|
||||
# USB Peripheral Controller
|
||||
@ -5359,15 +5358,10 @@ CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
|
||||
# CONFIG_USB_PXA27X is not set
|
||||
# CONFIG_USB_MV_UDC is not set
|
||||
# CONFIG_USB_MV_U3D is not set
|
||||
CONFIG_USB_SNP_CORE=y
|
||||
CONFIG_USB_SNP_UDC_PLAT=y
|
||||
# CONFIG_USB_SNP_UDC_PLAT is not set
|
||||
# CONFIG_USB_M66592 is not set
|
||||
# CONFIG_USB_BDC_UDC is not set
|
||||
# CONFIG_USB_AMD5536UDC is not set
|
||||
# CONFIG_USB_NET2272 is not set
|
||||
# CONFIG_USB_NET2280 is not set
|
||||
# CONFIG_USB_GOKU is not set
|
||||
# CONFIG_USB_EG20T is not set
|
||||
# CONFIG_USB_GADGET_XILINX is not set
|
||||
# CONFIG_USB_DUMMY_HCD is not set
|
||||
# end of USB Peripheral Controller
|
||||
@ -5388,7 +5382,6 @@ CONFIG_USB_F_RNDIS=m
|
||||
CONFIG_USB_F_MASS_STORAGE=m
|
||||
CONFIG_USB_F_FS=m
|
||||
CONFIG_USB_F_UAC1=m
|
||||
CONFIG_USB_F_UAC1_LEGACY=m
|
||||
CONFIG_USB_F_UAC2=m
|
||||
CONFIG_USB_F_UVC=m
|
||||
CONFIG_USB_F_MIDI=m
|
||||
@ -5407,12 +5400,37 @@ CONFIG_USB_CONFIGFS_MASS_STORAGE=y
|
||||
CONFIG_USB_CONFIGFS_F_LB_SS=y
|
||||
CONFIG_USB_CONFIGFS_F_FS=y
|
||||
CONFIG_USB_CONFIGFS_F_UAC1=y
|
||||
CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y
|
||||
# CONFIG_USB_CONFIGFS_F_UAC1_LEGACY is not set
|
||||
CONFIG_USB_CONFIGFS_F_UAC2=y
|
||||
CONFIG_USB_CONFIGFS_F_MIDI=y
|
||||
CONFIG_USB_CONFIGFS_F_HID=y
|
||||
CONFIG_USB_CONFIGFS_F_UVC=y
|
||||
CONFIG_USB_CONFIGFS_F_PRINTER=y
|
||||
CONFIG_USB_ZERO=m
|
||||
# CONFIG_USB_ZERO_HNPTEST is not set
|
||||
CONFIG_USB_AUDIO=m
|
||||
# CONFIG_GADGET_UAC1 is not set
|
||||
CONFIG_USB_ETH=m
|
||||
CONFIG_USB_ETH_RNDIS=y
|
||||
CONFIG_USB_ETH_EEM=y
|
||||
CONFIG_USB_G_NCM=m
|
||||
CONFIG_USB_GADGETFS=m
|
||||
CONFIG_USB_FUNCTIONFS=m
|
||||
CONFIG_USB_FUNCTIONFS_ETH=y
|
||||
CONFIG_USB_FUNCTIONFS_RNDIS=y
|
||||
CONFIG_USB_FUNCTIONFS_GENERIC=y
|
||||
CONFIG_USB_MASS_STORAGE=m
|
||||
CONFIG_USB_G_SERIAL=m
|
||||
CONFIG_USB_MIDI_GADGET=m
|
||||
CONFIG_USB_G_PRINTER=m
|
||||
CONFIG_USB_CDC_COMPOSITE=m
|
||||
CONFIG_USB_G_ACM_MS=m
|
||||
CONFIG_USB_G_MULTI=m
|
||||
CONFIG_USB_G_MULTI_RNDIS=y
|
||||
CONFIG_USB_G_MULTI_CDC=y
|
||||
CONFIG_USB_G_HID=m
|
||||
# CONFIG_USB_G_DBGP is not set
|
||||
CONFIG_USB_G_WEBCAM=m
|
||||
CONFIG_TYPEC=m
|
||||
CONFIG_TYPEC_TCPM=m
|
||||
CONFIG_TYPEC_TCPCI=m
|
||||
@ -6034,6 +6052,7 @@ CONFIG_ARM_SMMU_V3=y
|
||||
|
||||
CONFIG_ROCKCHIP_GRF=y
|
||||
CONFIG_ROCKCHIP_PM_DOMAINS=y
|
||||
CONFIG_VENDOR_FRIENDLYELEC=y
|
||||
# CONFIG_SOC_TI is not set
|
||||
|
||||
#
|
||||
@ -6057,6 +6076,7 @@ CONFIG_DEVFREQ_GOV_PASSIVE=m
|
||||
#
|
||||
# DEVFREQ Drivers
|
||||
#
|
||||
CONFIG_ARM_RK3328_DMC_DEVFREQ=y
|
||||
CONFIG_ARM_RK3399_DMC_DEVFREQ=y
|
||||
CONFIG_PM_DEVFREQ_EVENT=y
|
||||
CONFIG_DEVFREQ_EVENT_ROCKCHIP_DFI=y
|
||||
@ -6546,14 +6566,14 @@ CONFIG_PHY_MAPPHONE_MDM6600=m
|
||||
# CONFIG_PHY_OCELOT_SERDES is not set
|
||||
# CONFIG_PHY_QCOM_USB_HS is not set
|
||||
# CONFIG_PHY_QCOM_USB_HSIC is not set
|
||||
CONFIG_PHY_ROCKCHIP_DP=m
|
||||
CONFIG_PHY_ROCKCHIP_DP=y
|
||||
CONFIG_PHY_ROCKCHIP_EMMC=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_HDMI=m
|
||||
CONFIG_PHY_ROCKCHIP_INNO_HDMI=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB3=m
|
||||
CONFIG_PHY_ROCKCHIP_PCIE=m
|
||||
CONFIG_PHY_ROCKCHIP_TYPEC=m
|
||||
CONFIG_PHY_ROCKCHIP_USB=m
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB3=y
|
||||
CONFIG_PHY_ROCKCHIP_PCIE=y
|
||||
CONFIG_PHY_ROCKCHIP_TYPEC=y
|
||||
CONFIG_PHY_ROCKCHIP_USB=y
|
||||
CONFIG_PHY_SAMSUNG_USB2=y
|
||||
# CONFIG_PHY_TUSB1210 is not set
|
||||
# end of PHY Subsystem
|
||||
|
||||
@ -6,7 +6,7 @@ BOOTENV_FILE='rockchip-default.txt'
|
||||
UBOOT_TARGET_MAP=";;idbloader.bin uboot.img trust.bin"
|
||||
BOOTDELAY=0
|
||||
OVERLAY_PREFIX='rockchip'
|
||||
SERIALCON='ttyFIQ0:1500000'
|
||||
SERIALCON=${SERIALCON:-'ttyFIQ0:1500000'}
|
||||
ATFSOURCE='https://github.com/ayufan-rock64/arm-trusted-firmware'
|
||||
ATF_TARGET_MAP='M0_CROSS_COMPILE=arm-linux-gnueabi- PLAT=rk3399 DEBUG=1 bl31;;trust.bin'
|
||||
ATF_TOOLCHAIN2="arm-linux-gnueabi-:> 5.0"
|
||||
@ -146,8 +146,18 @@ family_tweaks_bsp()
|
||||
|
||||
fi
|
||||
|
||||
if [[ $BOARD == pinebook-pro ]]; then
|
||||
if [[ $BOARD == nanopi-r2s ]]; then
|
||||
|
||||
# rename USB based network to lan0
|
||||
mkdir -p $destination/etc/udev/rules.d/
|
||||
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="r8152", KERNEL=="eth1", NAME="lan0"' > $destination/etc/udev/rules.d/70-rename-lan.rules
|
||||
# this board is without BT
|
||||
rm $destination/lib/systemd/system/rk3399-bluetooth.service
|
||||
|
||||
fi
|
||||
|
||||
if [[ $BOARD == pinebook-pro ]]; then
|
||||
|
||||
cp $SRC/packages/bsp/pinebook-pro/xorg.conf $destination/etc/X11/
|
||||
fi
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
THIS_SCRIPT="sysinfo"
|
||||
MOTD_DISABLE=""
|
||||
STORAGE=/dev/sda1
|
||||
SHOW_IP_PATTERN="^bond.*|^[ewr].*|^br.*|^lt.*|^umts.*"
|
||||
SHOW_IP_PATTERN="^bond.*|^[ewr].*|^br.*|^lt.*|^umts.*|^lan.*"
|
||||
|
||||
CPU_TEMP_LIMIT=45
|
||||
AMB_TEMP_LIMIT=40
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
From 2d4f786f94b331904682c24a792462726d474007 Mon Sep 17 00:00:00 2001
|
||||
From: hmz007 <hmz007@gmail.com>
|
||||
Date: Mon, 23 Dec 2019 13:10:06 +0800
|
||||
Subject: [PATCH] r8152: Add module param for customized LEDs
|
||||
|
||||
Signed-off-by: hmz007 <hmz007@gmail.com>
|
||||
---
|
||||
drivers/net/usb/r8152.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
|
||||
index eb78f6d9390c..ec737fffcded 100644
|
||||
--- a/drivers/net/usb/r8152.c
|
||||
+++ b/drivers/net/usb/r8152.c
|
||||
@@ -37,6 +37,11 @@
|
||||
#define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
|
||||
#define MODULENAME "r8152"
|
||||
|
||||
+/* LED0: Activity, LED1: Link */
|
||||
+static int ledsel = 0x78;
|
||||
+module_param(ledsel, int, 0);
|
||||
+MODULE_PARM_DESC(ledsel, "Override default LED configuration");
|
||||
+
|
||||
#define R8152_PHY_ID 32
|
||||
|
||||
#define PLA_IDR 0xc000
|
||||
@@ -4545,6 +4550,9 @@ static void r8153b_init(struct r8152 *tp)
|
||||
ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
|
||||
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
|
||||
|
||||
+ /* set customized led */
|
||||
+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_LEDSEL, ledsel);
|
||||
+
|
||||
rtl_tally_reset(tp);
|
||||
|
||||
tp->coalesce = 15000; /* 15 us */
|
||||
@ -0,0 +1,40 @@
|
||||
From 27dfe6f4347e883fd618d5a37500c7f6d3652fb9 Mon Sep 17 00:00:00 2001
|
||||
From: hmz007 <hmz007@gmail.com>
|
||||
Date: Fri, 22 Nov 2019 19:03:00 +0800
|
||||
Subject: [PATCH] r8152: support to get MAC address from device tree
|
||||
|
||||
Signed-off-by: hmz007 <hmz007@gmail.com>
|
||||
---
|
||||
drivers/net/usb/r8152.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
|
||||
index b2507c59ba8b..eb78f6d9390c 100644
|
||||
--- a/drivers/net/usb/r8152.c
|
||||
+++ b/drivers/net/usb/r8152.c
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <linux/signal.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/module.h>
|
||||
+#include <linux/of_net.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/mii.h>
|
||||
@@ -1298,6 +1299,17 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa)
|
||||
if (ret < 0) {
|
||||
netif_err(tp, probe, dev, "Get ether addr fail\n");
|
||||
} else if (!is_valid_ether_addr(sa->sa_data)) {
|
||||
+ /* try to get MAC address from DT */
|
||||
+ if (tp->udev->dev.of_node) {
|
||||
+ const u8 *mac = of_get_mac_address(tp->udev->dev.of_node);
|
||||
+ if (!IS_ERR(mac) && is_valid_ether_addr(mac)) {
|
||||
+ ether_addr_copy(sa->sa_data, mac);
|
||||
+ netif_info(tp, probe, dev, "DT mac addr %pM\n",
|
||||
+ sa->sa_data);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
netif_err(tp, probe, dev, "Invalid ether addr %pM\n",
|
||||
sa->sa_data);
|
||||
eth_hw_addr_random(dev);
|
||||
1361
patch/kernel/rockchip64-current/add-board-nanopi-r2s.patch
Normal file
1361
patch/kernel/rockchip64-current/add-board-nanopi-r2s.patch
Normal file
File diff suppressed because it is too large
Load Diff
211
patch/kernel/rockchip64-current/add-maker-friendlyarm.patch
Normal file
211
patch/kernel/rockchip64-current/add-maker-friendlyarm.patch
Normal file
@ -0,0 +1,211 @@
|
||||
From 2fc2cbaaaf0dcebdeffa6e87bbc9ad843a5470dd Mon Sep 17 00:00:00 2001
|
||||
From: hmz007 <hmz007@gmail.com>
|
||||
Date: Sat, 11 Jan 2020 19:35:03 +0800
|
||||
Subject: [PATCH] soc: friendlyelec: Add board info driver
|
||||
|
||||
Change-Id: I122adb4f99c816b5c177f16392fb2df9c10a47be
|
||||
Signed-off-by: hmz007 <hmz007@gmail.com>
|
||||
---
|
||||
drivers/soc/Kconfig | 1 +
|
||||
drivers/soc/Makefile | 1 +
|
||||
drivers/soc/friendlyelec/Kconfig | 11 ++
|
||||
drivers/soc/friendlyelec/Makefile | 1 +
|
||||
drivers/soc/friendlyelec/board.c | 143 ++++++++++++++++++
|
||||
8 files changed, 161 insertions(+)
|
||||
create mode 100644 drivers/soc/friendlyelec/Kconfig
|
||||
create mode 100644 drivers/soc/friendlyelec/Makefile
|
||||
create mode 100644 drivers/soc/friendlyelec/board.c
|
||||
|
||||
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
|
||||
index 833e04a7835c..9ddbd976395d 100644
|
||||
--- a/drivers/soc/Kconfig
|
||||
+++ b/drivers/soc/Kconfig
|
||||
@@ -21,5 +21,6 @@ source "drivers/soc/ux500/Kconfig"
|
||||
source "drivers/soc/versatile/Kconfig"
|
||||
source "drivers/soc/xilinx/Kconfig"
|
||||
source "drivers/soc/zte/Kconfig"
|
||||
+source "drivers/soc/friendlyelec/Kconfig"
|
||||
|
||||
endmenu
|
||||
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
|
||||
index 2ec355003524..277b5bf269c7 100644
|
||||
--- a/drivers/soc/Makefile
|
||||
+++ b/drivers/soc/Makefile
|
||||
@@ -27,3 +27,4 @@ obj-$(CONFIG_ARCH_U8500) += ux500/
|
||||
obj-$(CONFIG_PLAT_VERSATILE) += versatile/
|
||||
obj-y += xilinx/
|
||||
obj-$(CONFIG_ARCH_ZX) += zte/
|
||||
+obj-$(CONFIG_VENDOR_FRIENDLYELEC) += friendlyelec/
|
||||
diff --git a/drivers/soc/friendlyelec/Kconfig b/drivers/soc/friendlyelec/Kconfig
|
||||
new file mode 100644
|
||||
index 000000000000..9e21c663e6c8
|
||||
--- /dev/null
|
||||
+++ b/drivers/soc/friendlyelec/Kconfig
|
||||
@@ -0,0 +1,11 @@
|
||||
+#
|
||||
+# Machine drivers
|
||||
+#
|
||||
+
|
||||
+if ARCH_ROCKCHIP
|
||||
+
|
||||
+config VENDOR_FRIENDLYELEC
|
||||
+ bool "FriendlyElec board based on RK33XX SoCs"
|
||||
+ default n
|
||||
+
|
||||
+endif
|
||||
diff --git a/drivers/soc/friendlyelec/Makefile b/drivers/soc/friendlyelec/Makefile
|
||||
new file mode 100644
|
||||
index 000000000000..870542f05177
|
||||
--- /dev/null
|
||||
+++ b/drivers/soc/friendlyelec/Makefile
|
||||
@@ -0,0 +1 @@
|
||||
+obj-$(CONFIG_VENDOR_FRIENDLYELEC) += board.o
|
||||
diff --git a/drivers/soc/friendlyelec/board.c b/drivers/soc/friendlyelec/board.c
|
||||
new file mode 100644
|
||||
index 000000000000..886a8e1f7dc0
|
||||
--- /dev/null
|
||||
+++ b/drivers/soc/friendlyelec/board.c
|
||||
@@ -0,0 +1,143 @@
|
||||
+/*
|
||||
+ * Copyright (C) Guangzhou FriendlyELEC Computer Tech. Co., Ltd.
|
||||
+ * (http://www.friendlyarm.com)
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License
|
||||
+ * as published by the Free Software Foundation; either version 2
|
||||
+ * of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, you can access it online at
|
||||
+ * http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/types.h>
|
||||
+#include <linux/io.h>
|
||||
+#include <linux/of.h>
|
||||
+#include <linux/of_platform.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/crc32.h>
|
||||
+#include <linux/nvmem-consumer.h>
|
||||
+
|
||||
+#define BOARD_MANF "FriendlyELEC Computer Tech. Co., Ltd."
|
||||
+
|
||||
+static const char *board_mach;
|
||||
+static const char *board_name;
|
||||
+static u32 board_rev;
|
||||
+static u32 board_serial_high, board_serial_low;
|
||||
+
|
||||
+static ssize_t board_sys_info_show(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ char *s = buf;
|
||||
+
|
||||
+ s += sprintf(s, "Hardware\t: %s\n", board_mach);
|
||||
+ s += sprintf(s, "Revision\t: %04x\n", board_rev);
|
||||
+ s += sprintf(s, "Serial\t\t: %08x%08x\n",
|
||||
+ board_serial_high, board_serial_low);
|
||||
+ s += sprintf(s, "\nModel\t\t: %s\n", board_name);
|
||||
+ s += sprintf(s, "Manufacturer\t: %s\n", BOARD_MANF);
|
||||
+
|
||||
+ return (s - buf);
|
||||
+}
|
||||
+
|
||||
+static struct device_attribute board_attr_info =
|
||||
+ __ATTR(info, S_IRUGO, board_sys_info_show, NULL);
|
||||
+
|
||||
+static int rockchip_cpuinfo_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct nvmem_cell *cell;
|
||||
+ unsigned char *efuse_buf, buf[16];
|
||||
+ size_t len;
|
||||
+ int i;
|
||||
+
|
||||
+ cell = nvmem_cell_get(dev, "id");
|
||||
+ if (IS_ERR(cell)) {
|
||||
+ dev_err(dev, "failed to get id cell: %ld\n", PTR_ERR(cell));
|
||||
+ return PTR_ERR(cell);
|
||||
+ }
|
||||
+
|
||||
+ efuse_buf = nvmem_cell_read(cell, &len);
|
||||
+ nvmem_cell_put(cell);
|
||||
+
|
||||
+ if (len != 16) {
|
||||
+ kfree(efuse_buf);
|
||||
+ dev_err(dev, "invalid id len: %zu\n", len);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < 8; i++) {
|
||||
+ buf[i] = efuse_buf[1 + (i << 1)];
|
||||
+ buf[i + 8] = efuse_buf[i << 1];
|
||||
+ }
|
||||
+
|
||||
+ kfree(efuse_buf);
|
||||
+
|
||||
+ board_serial_low = crc32(0, buf, 8);
|
||||
+ board_serial_high = crc32(board_serial_low, buf + 8, 8);
|
||||
+
|
||||
+ dev_info(dev, "Serial\t\t: %08x%08x\n",
|
||||
+ board_serial_high, board_serial_low);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int board_sys_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device_node *np = pdev->dev.of_node;
|
||||
+ struct device_node *root;
|
||||
+
|
||||
+ root = of_find_node_by_path("/");
|
||||
+
|
||||
+ of_property_read_u32(np, "hwrev", &board_rev);
|
||||
+
|
||||
+ if (of_property_read_string(np, "machine", &board_mach))
|
||||
+ of_property_read_string(root, "compatible", &board_mach);
|
||||
+
|
||||
+ if (of_property_read_string(np, "model", &board_name))
|
||||
+ of_property_read_string(root, "model", &board_name);
|
||||
+
|
||||
+ of_node_put(root);
|
||||
+
|
||||
+ rockchip_cpuinfo_probe(pdev);
|
||||
+
|
||||
+ device_create_file(&pdev->dev, &board_attr_info);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id board_sys_of_match[] = {
|
||||
+ { .compatible = "friendlyelec,board" },
|
||||
+ {}
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, board_sys_of_match);
|
||||
+
|
||||
+static struct platform_driver board_sys_driver = {
|
||||
+ .probe = board_sys_probe,
|
||||
+ .driver = {
|
||||
+ .name = "friendlyelec-board",
|
||||
+ .of_match_table = board_sys_of_match,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static int __init board_sys_init(void)
|
||||
+{
|
||||
+ return platform_driver_register(&board_sys_driver);
|
||||
+}
|
||||
+late_initcall(board_sys_init);
|
||||
+
|
||||
+MODULE_AUTHOR("support@friendlyarm.com");
|
||||
+MODULE_DESCRIPTION("FriendlyElec NanoPi Series Machine Driver");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
0
patch/kernel/rockchip64-current/add-rk3328-usb3-phy-driver.patch
Executable file → Normal file
0
patch/kernel/rockchip64-current/add-rk3328-usb3-phy-driver.patch
Executable file → Normal file
1796
patch/kernel/rockchip64-current/rk3328-add-dmc-driver.patch
Normal file
1796
patch/kernel/rockchip64-current/rk3328-add-dmc-driver.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,48 @@
|
||||
From 6376a1b0e30a1d30c4269083fb5b9a146a944ada Mon Sep 17 00:00:00 2001
|
||||
From: Ziyuan Xu <xzy.xu@rock-chips.com>
|
||||
Date: Wed, 28 Nov 2018 17:39:50 +0800
|
||||
Subject: [PATCH] Revert "clk: rockchip: fix wrong mmc phase shift for rk3328"
|
||||
|
||||
This reverts commit 4ef244988993afc8a6447e990a4ccb4a223d3f20.
|
||||
|
||||
The description for CRU_EMMC/SDMMC/SDIO_CON[0/1] is jumble on
|
||||
chapters, make it clear that the correct shift is 1 that from
|
||||
IC engineer.
|
||||
|
||||
Change-Id: I48dce293ec6ef82a5c78db38efc083227776ea99
|
||||
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
|
||||
---
|
||||
drivers/clk/rockchip/clk-rk3328.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/rockchip/clk-rk3328.c b/drivers/clk/rockchip/clk-rk3328.c
|
||||
index ac6e6163a232..d77925271198 100644
|
||||
--- a/drivers/clk/rockchip/clk-rk3328.c
|
||||
+++ b/drivers/clk/rockchip/clk-rk3328.c
|
||||
@@ -809,22 +809,22 @@ static struct rockchip_clk_branch rk3328_clk_branches[] __initdata = {
|
||||
MMC(SCLK_SDMMC_DRV, "sdmmc_drv", "clk_sdmmc",
|
||||
RK3328_SDMMC_CON0, 1),
|
||||
MMC(SCLK_SDMMC_SAMPLE, "sdmmc_sample", "clk_sdmmc",
|
||||
- RK3328_SDMMC_CON1, 0),
|
||||
+ RK3328_SDMMC_CON1, 1),
|
||||
|
||||
MMC(SCLK_SDIO_DRV, "sdio_drv", "clk_sdio",
|
||||
RK3328_SDIO_CON0, 1),
|
||||
MMC(SCLK_SDIO_SAMPLE, "sdio_sample", "clk_sdio",
|
||||
- RK3328_SDIO_CON1, 0),
|
||||
+ RK3328_SDIO_CON1, 1),
|
||||
|
||||
MMC(SCLK_EMMC_DRV, "emmc_drv", "clk_emmc",
|
||||
RK3328_EMMC_CON0, 1),
|
||||
MMC(SCLK_EMMC_SAMPLE, "emmc_sample", "clk_emmc",
|
||||
- RK3328_EMMC_CON1, 0),
|
||||
+ RK3328_EMMC_CON1, 1),
|
||||
|
||||
MMC(SCLK_SDMMC_EXT_DRV, "sdmmc_ext_drv", "clk_sdmmc_ext",
|
||||
RK3328_SDMMC_EXT_CON0, 1),
|
||||
MMC(SCLK_SDMMC_EXT_SAMPLE, "sdmmc_ext_sample", "clk_sdmmc_ext",
|
||||
- RK3328_SDMMC_EXT_CON1, 0),
|
||||
+ RK3328_SDMMC_EXT_CON1, 1),
|
||||
};
|
||||
|
||||
static const char *const rk3328_critical_clocks[] __initconst = {
|
||||
Loading…
Reference in New Issue
Block a user