mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
rockchip: copy patch archive from 5.16 to 5.17
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
|
||||
index a98dee2ae..d3cef7033 100644
|
||||
--- a/arch/arm/boot/dts/Makefile
|
||||
+++ b/arch/arm/boot/dts/Makefile
|
||||
@@ -916,17 +916,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
|
||||
rk3288-rock2-square.dtb \
|
||||
rk3288-tinker.dtb \
|
||||
rk3288-tinker-s.dtb \
|
||||
- rk3288-veyron-brain.dtb \
|
||||
- rk3288-veyron-fievel.dtb \
|
||||
- rk3288-veyron-jaq.dtb \
|
||||
- rk3288-veyron-jerry.dtb \
|
||||
- rk3288-veyron-mickey.dtb \
|
||||
- rk3288-veyron-mighty.dtb \
|
||||
- rk3288-veyron-minnie.dtb \
|
||||
- rk3288-veyron-pinky.dtb \
|
||||
- rk3288-veyron-speedy.dtb \
|
||||
- rk3288-veyron-tiger.dtb \
|
||||
rk3288-vyasa.dtb
|
||||
dtb-$(CONFIG_ARCH_S3C24XX) += \
|
||||
s3c2416-smdk2416.dtb
|
||||
dtb-$(CONFIG_ARCH_S3C64XX) += \
|
||||
@@ -0,0 +1,287 @@
|
||||
From 3ec70749ae3cb072f19d886981a217121f776415 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
||||
Date: Sat, 6 Nov 2021 19:15:23 +0100
|
||||
Subject: [PATCH] Revert "net: Remove net/ipx.h and uapi/linux/ipx.h header
|
||||
files"
|
||||
|
||||
This reverts commit 6c9b40844751ea30c72f7a2f92f4d704bc6b2927.
|
||||
---
|
||||
include/net/ipx.h | 171 +++++++++++++++++++++++++++++++++++++++
|
||||
include/uapi/linux/ipx.h | 87 ++++++++++++++++++++
|
||||
2 files changed, 258 insertions(+)
|
||||
create mode 100644 include/net/ipx.h
|
||||
create mode 100644 include/uapi/linux/ipx.h
|
||||
|
||||
diff --git a/include/net/ipx.h b/include/net/ipx.h
|
||||
new file mode 100644
|
||||
index 000000000000..9d1342807b59
|
||||
--- /dev/null
|
||||
+++ b/include/net/ipx.h
|
||||
@@ -0,0 +1,171 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0 */
|
||||
+#ifndef _NET_INET_IPX_H_
|
||||
+#define _NET_INET_IPX_H_
|
||||
+/*
|
||||
+ * The following information is in its entirety obtained from:
|
||||
+ *
|
||||
+ * Novell 'IPX Router Specification' Version 1.10
|
||||
+ * Part No. 107-000029-001
|
||||
+ *
|
||||
+ * Which is available from ftp.novell.com
|
||||
+ */
|
||||
+
|
||||
+#include <linux/netdevice.h>
|
||||
+#include <net/datalink.h>
|
||||
+#include <linux/ipx.h>
|
||||
+#include <linux/list.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/refcount.h>
|
||||
+
|
||||
+struct ipx_address {
|
||||
+ __be32 net;
|
||||
+ __u8 node[IPX_NODE_LEN];
|
||||
+ __be16 sock;
|
||||
+};
|
||||
+
|
||||
+#define ipx_broadcast_node "\377\377\377\377\377\377"
|
||||
+#define ipx_this_node "\0\0\0\0\0\0"
|
||||
+
|
||||
+#define IPX_MAX_PPROP_HOPS 8
|
||||
+
|
||||
+struct ipxhdr {
|
||||
+ __be16 ipx_checksum __packed;
|
||||
+#define IPX_NO_CHECKSUM cpu_to_be16(0xFFFF)
|
||||
+ __be16 ipx_pktsize __packed;
|
||||
+ __u8 ipx_tctrl;
|
||||
+ __u8 ipx_type;
|
||||
+#define IPX_TYPE_UNKNOWN 0x00
|
||||
+#define IPX_TYPE_RIP 0x01 /* may also be 0 */
|
||||
+#define IPX_TYPE_SAP 0x04 /* may also be 0 */
|
||||
+#define IPX_TYPE_SPX 0x05 /* SPX protocol */
|
||||
+#define IPX_TYPE_NCP 0x11 /* $lots for docs on this (SPIT) */
|
||||
+#define IPX_TYPE_PPROP 0x14 /* complicated flood fill brdcast */
|
||||
+ struct ipx_address ipx_dest __packed;
|
||||
+ struct ipx_address ipx_source __packed;
|
||||
+};
|
||||
+
|
||||
+/* From af_ipx.c */
|
||||
+extern int sysctl_ipx_pprop_broadcasting;
|
||||
+
|
||||
+struct ipx_interface {
|
||||
+ /* IPX address */
|
||||
+ __be32 if_netnum;
|
||||
+ unsigned char if_node[IPX_NODE_LEN];
|
||||
+ refcount_t refcnt;
|
||||
+
|
||||
+ /* physical device info */
|
||||
+ struct net_device *if_dev;
|
||||
+ struct datalink_proto *if_dlink;
|
||||
+ __be16 if_dlink_type;
|
||||
+
|
||||
+ /* socket support */
|
||||
+ unsigned short if_sknum;
|
||||
+ struct hlist_head if_sklist;
|
||||
+ spinlock_t if_sklist_lock;
|
||||
+
|
||||
+ /* administrative overhead */
|
||||
+ int if_ipx_offset;
|
||||
+ unsigned char if_internal;
|
||||
+ unsigned char if_primary;
|
||||
+
|
||||
+ struct list_head node; /* node in ipx_interfaces list */
|
||||
+};
|
||||
+
|
||||
+struct ipx_route {
|
||||
+ __be32 ir_net;
|
||||
+ struct ipx_interface *ir_intrfc;
|
||||
+ unsigned char ir_routed;
|
||||
+ unsigned char ir_router_node[IPX_NODE_LEN];
|
||||
+ struct list_head node; /* node in ipx_routes list */
|
||||
+ refcount_t refcnt;
|
||||
+};
|
||||
+
|
||||
+struct ipx_cb {
|
||||
+ u8 ipx_tctrl;
|
||||
+ __be32 ipx_dest_net;
|
||||
+ __be32 ipx_source_net;
|
||||
+ struct {
|
||||
+ __be32 netnum;
|
||||
+ int index;
|
||||
+ } last_hop;
|
||||
+};
|
||||
+
|
||||
+#include <net/sock.h>
|
||||
+
|
||||
+struct ipx_sock {
|
||||
+ /* struct sock has to be the first member of ipx_sock */
|
||||
+ struct sock sk;
|
||||
+ struct ipx_address dest_addr;
|
||||
+ struct ipx_interface *intrfc;
|
||||
+ __be16 port;
|
||||
+#ifdef CONFIG_IPX_INTERN
|
||||
+ unsigned char node[IPX_NODE_LEN];
|
||||
+#endif
|
||||
+ unsigned short type;
|
||||
+ /*
|
||||
+ * To handle special ncp connection-handling sockets for mars_nwe,
|
||||
+ * the connection number must be stored in the socket.
|
||||
+ */
|
||||
+ unsigned short ipx_ncp_conn;
|
||||
+};
|
||||
+
|
||||
+static inline struct ipx_sock *ipx_sk(struct sock *sk)
|
||||
+{
|
||||
+ return (struct ipx_sock *)sk;
|
||||
+}
|
||||
+
|
||||
+#define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0]))
|
||||
+
|
||||
+#define IPX_MIN_EPHEMERAL_SOCKET 0x4000
|
||||
+#define IPX_MAX_EPHEMERAL_SOCKET 0x7fff
|
||||
+
|
||||
+extern struct list_head ipx_routes;
|
||||
+extern rwlock_t ipx_routes_lock;
|
||||
+
|
||||
+extern struct list_head ipx_interfaces;
|
||||
+struct ipx_interface *ipx_interfaces_head(void);
|
||||
+extern spinlock_t ipx_interfaces_lock;
|
||||
+
|
||||
+extern struct ipx_interface *ipx_primary_net;
|
||||
+
|
||||
+int ipx_proc_init(void);
|
||||
+void ipx_proc_exit(void);
|
||||
+
|
||||
+const char *ipx_frame_name(__be16);
|
||||
+const char *ipx_device_name(struct ipx_interface *intrfc);
|
||||
+
|
||||
+static __inline__ void ipxitf_hold(struct ipx_interface *intrfc)
|
||||
+{
|
||||
+ refcount_inc(&intrfc->refcnt);
|
||||
+}
|
||||
+
|
||||
+void ipxitf_down(struct ipx_interface *intrfc);
|
||||
+struct ipx_interface *ipxitf_find_using_net(__be32 net);
|
||||
+int ipxitf_send(struct ipx_interface *intrfc, struct sk_buff *skb, char *node);
|
||||
+__be16 ipx_cksum(struct ipxhdr *packet, int length);
|
||||
+int ipxrtr_add_route(__be32 network, struct ipx_interface *intrfc,
|
||||
+ unsigned char *node);
|
||||
+void ipxrtr_del_routes(struct ipx_interface *intrfc);
|
||||
+int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
|
||||
+ struct msghdr *msg, size_t len, int noblock);
|
||||
+int ipxrtr_route_skb(struct sk_buff *skb);
|
||||
+struct ipx_route *ipxrtr_lookup(__be32 net);
|
||||
+int ipxrtr_ioctl(unsigned int cmd, void __user *arg);
|
||||
+
|
||||
+static __inline__ void ipxitf_put(struct ipx_interface *intrfc)
|
||||
+{
|
||||
+ if (refcount_dec_and_test(&intrfc->refcnt))
|
||||
+ ipxitf_down(intrfc);
|
||||
+}
|
||||
+
|
||||
+static __inline__ void ipxrtr_hold(struct ipx_route *rt)
|
||||
+{
|
||||
+ refcount_inc(&rt->refcnt);
|
||||
+}
|
||||
+
|
||||
+static __inline__ void ipxrtr_put(struct ipx_route *rt)
|
||||
+{
|
||||
+ if (refcount_dec_and_test(&rt->refcnt))
|
||||
+ kfree(rt);
|
||||
+}
|
||||
+#endif /* _NET_INET_IPX_H_ */
|
||||
diff --git a/include/uapi/linux/ipx.h b/include/uapi/linux/ipx.h
|
||||
new file mode 100644
|
||||
index 000000000000..3168137adae8
|
||||
--- /dev/null
|
||||
+++ b/include/uapi/linux/ipx.h
|
||||
@@ -0,0 +1,87 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
+#ifndef _IPX_H_
|
||||
+#define _IPX_H_
|
||||
+#include <linux/libc-compat.h> /* for compatibility with glibc netipx/ipx.h */
|
||||
+#include <linux/types.h>
|
||||
+#include <linux/sockios.h>
|
||||
+#include <linux/socket.h>
|
||||
+#define IPX_NODE_LEN 6
|
||||
+#define IPX_MTU 576
|
||||
+
|
||||
+#if __UAPI_DEF_SOCKADDR_IPX
|
||||
+struct sockaddr_ipx {
|
||||
+ __kernel_sa_family_t sipx_family;
|
||||
+ __be16 sipx_port;
|
||||
+ __be32 sipx_network;
|
||||
+ unsigned char sipx_node[IPX_NODE_LEN];
|
||||
+ __u8 sipx_type;
|
||||
+ unsigned char sipx_zero; /* 16 byte fill */
|
||||
+};
|
||||
+#endif /* __UAPI_DEF_SOCKADDR_IPX */
|
||||
+
|
||||
+/*
|
||||
+ * So we can fit the extra info for SIOCSIFADDR into the address nicely
|
||||
+ */
|
||||
+#define sipx_special sipx_port
|
||||
+#define sipx_action sipx_zero
|
||||
+#define IPX_DLTITF 0
|
||||
+#define IPX_CRTITF 1
|
||||
+
|
||||
+#if __UAPI_DEF_IPX_ROUTE_DEFINITION
|
||||
+struct ipx_route_definition {
|
||||
+ __be32 ipx_network;
|
||||
+ __be32 ipx_router_network;
|
||||
+ unsigned char ipx_router_node[IPX_NODE_LEN];
|
||||
+};
|
||||
+#endif /* __UAPI_DEF_IPX_ROUTE_DEFINITION */
|
||||
+
|
||||
+#if __UAPI_DEF_IPX_INTERFACE_DEFINITION
|
||||
+struct ipx_interface_definition {
|
||||
+ __be32 ipx_network;
|
||||
+ unsigned char ipx_device[16];
|
||||
+ unsigned char ipx_dlink_type;
|
||||
+#define IPX_FRAME_NONE 0
|
||||
+#define IPX_FRAME_SNAP 1
|
||||
+#define IPX_FRAME_8022 2
|
||||
+#define IPX_FRAME_ETHERII 3
|
||||
+#define IPX_FRAME_8023 4
|
||||
+#define IPX_FRAME_TR_8022 5 /* obsolete */
|
||||
+ unsigned char ipx_special;
|
||||
+#define IPX_SPECIAL_NONE 0
|
||||
+#define IPX_PRIMARY 1
|
||||
+#define IPX_INTERNAL 2
|
||||
+ unsigned char ipx_node[IPX_NODE_LEN];
|
||||
+};
|
||||
+#endif /* __UAPI_DEF_IPX_INTERFACE_DEFINITION */
|
||||
+
|
||||
+#if __UAPI_DEF_IPX_CONFIG_DATA
|
||||
+struct ipx_config_data {
|
||||
+ unsigned char ipxcfg_auto_select_primary;
|
||||
+ unsigned char ipxcfg_auto_create_interfaces;
|
||||
+};
|
||||
+#endif /* __UAPI_DEF_IPX_CONFIG_DATA */
|
||||
+
|
||||
+/*
|
||||
+ * OLD Route Definition for backward compatibility.
|
||||
+ */
|
||||
+
|
||||
+#if __UAPI_DEF_IPX_ROUTE_DEF
|
||||
+struct ipx_route_def {
|
||||
+ __be32 ipx_network;
|
||||
+ __be32 ipx_router_network;
|
||||
+#define IPX_ROUTE_NO_ROUTER 0
|
||||
+ unsigned char ipx_router_node[IPX_NODE_LEN];
|
||||
+ unsigned char ipx_device[16];
|
||||
+ unsigned short ipx_flags;
|
||||
+#define IPX_RT_SNAP 8
|
||||
+#define IPX_RT_8022 4
|
||||
+#define IPX_RT_BLUEBOOK 2
|
||||
+#define IPX_RT_ROUTED 1
|
||||
+};
|
||||
+#endif /* __UAPI_DEF_IPX_ROUTE_DEF */
|
||||
+
|
||||
+#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
|
||||
+#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1)
|
||||
+#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2)
|
||||
+#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3)
|
||||
+#endif /* _IPX_H_ */
|
||||
--
|
||||
2.25.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,406 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sat, 10 Oct 2020 15:32:18 +0000
|
||||
Subject: [PATCH] phy/rockchip: inno-hdmi: use correct vco_div_5 macro on
|
||||
rk3328
|
||||
|
||||
inno_hdmi_phy_rk3328_clk_set_rate() is using the RK3228 macro
|
||||
when configuring vco_div_5 on RK3328.
|
||||
|
||||
Fix this by using correct vco_div_5 macro for RK3328.
|
||||
|
||||
Fixes: 53706a116863 ("phy: add Rockchip Innosilicon hdmi phy")
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
index 80acca4e9e14..15339338aae3 100644
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
@@ -790,8 +790,8 @@ static int inno_hdmi_phy_rk3328_clk_set_rate(struct clk_hw *hw,
|
||||
RK3328_PRE_PLL_POWER_DOWN);
|
||||
|
||||
/* Configure pre-pll */
|
||||
- inno_update_bits(inno, 0xa0, RK3228_PCLK_VCO_DIV_5_MASK,
|
||||
- RK3228_PCLK_VCO_DIV_5(cfg->vco_div_5_en));
|
||||
+ inno_update_bits(inno, 0xa0, RK3328_PCLK_VCO_DIV_5_MASK,
|
||||
+ RK3328_PCLK_VCO_DIV_5(cfg->vco_div_5_en));
|
||||
inno_write(inno, 0xa1, RK3328_PRE_PLL_PRE_DIV(cfg->prediv));
|
||||
|
||||
val = RK3328_SPREAD_SPECTRUM_MOD_DISABLE;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zheng Yang <zhengyang@rock-chips.com>
|
||||
Date: Sat, 10 Oct 2020 15:32:18 +0000
|
||||
Subject: [PATCH] phy/rockchip: inno-hdmi: round fractal pixclock in rk3328
|
||||
recalc_rate
|
||||
|
||||
inno_hdmi_phy_rk3328_clk_recalc_rate() is returning a rate not found
|
||||
in the pre pll config table when the fractal divider is used.
|
||||
This can prevent proper power_on because a tmdsclock for the new rate
|
||||
is not found in the pre pll config table.
|
||||
|
||||
Fix this by saving and returning a rounded pixel rate that exist
|
||||
in the pre pll config table.
|
||||
|
||||
Fixes: 53706a116863 ("phy: add Rockchip Innosilicon hdmi phy")
|
||||
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
index 15339338aae3..15a008a1ac7b 100644
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
@@ -745,10 +745,12 @@ unsigned long inno_hdmi_phy_rk3328_clk_recalc_rate(struct clk_hw *hw,
|
||||
do_div(vco, (nd * (no_a == 1 ? no_b : no_a) * no_d * 2));
|
||||
}
|
||||
|
||||
- inno->pixclock = vco;
|
||||
- dev_dbg(inno->dev, "%s rate %lu\n", __func__, inno->pixclock);
|
||||
+ inno->pixclock = DIV_ROUND_CLOSEST((unsigned long)vco, 1000) * 1000;
|
||||
|
||||
- return vco;
|
||||
+ dev_dbg(inno->dev, "%s rate %lu vco %llu\n",
|
||||
+ __func__, inno->pixclock, vco);
|
||||
+
|
||||
+ return inno->pixclock;
|
||||
}
|
||||
|
||||
static long inno_hdmi_phy_rk3328_clk_round_rate(struct clk_hw *hw,
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sat, 10 Oct 2020 15:32:19 +0000
|
||||
Subject: [PATCH] phy/rockchip: inno-hdmi: remove unused no_c from rk3328
|
||||
recalc_rate
|
||||
|
||||
no_c is not used in any calculation, lets remove it.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
index 15a008a1ac7b..4b936ca19920 100644
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
@@ -714,7 +714,7 @@ unsigned long inno_hdmi_phy_rk3328_clk_recalc_rate(struct clk_hw *hw,
|
||||
{
|
||||
struct inno_hdmi_phy *inno = to_inno_hdmi_phy(hw);
|
||||
unsigned long frac;
|
||||
- u8 nd, no_a, no_b, no_c, no_d;
|
||||
+ u8 nd, no_a, no_b, no_d;
|
||||
u64 vco;
|
||||
u16 nf;
|
||||
|
||||
@@ -737,9 +737,6 @@ unsigned long inno_hdmi_phy_rk3328_clk_recalc_rate(struct clk_hw *hw,
|
||||
no_b = inno_read(inno, 0xa5) & RK3328_PRE_PLL_PCLK_DIV_B_MASK;
|
||||
no_b >>= RK3328_PRE_PLL_PCLK_DIV_B_SHIFT;
|
||||
no_b += 2;
|
||||
- no_c = inno_read(inno, 0xa6) & RK3328_PRE_PLL_PCLK_DIV_C_MASK;
|
||||
- no_c >>= RK3328_PRE_PLL_PCLK_DIV_C_SHIFT;
|
||||
- no_c = 1 << no_c;
|
||||
no_d = inno_read(inno, 0xa6) & RK3328_PRE_PLL_PCLK_DIV_D_MASK;
|
||||
|
||||
do_div(vco, (nd * (no_a == 1 ? no_b : no_a) * no_d * 2));
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sat, 10 Oct 2020 15:32:19 +0000
|
||||
Subject: [PATCH] phy/rockchip: inno-hdmi: do not power on rk3328 post pll on
|
||||
reg write
|
||||
|
||||
inno_write is used to configure 0xaa reg, that also hold the
|
||||
POST_PLL_POWER_DOWN bit.
|
||||
When POST_PLL_REFCLK_SEL_TMDS is configured the power down bit is not
|
||||
taken into consideration.
|
||||
|
||||
Fix this by keeping the power down bit until configuration is complete.
|
||||
Also reorder the reg write order for consistency.
|
||||
|
||||
Fixes: 53706a116863 ("phy: add Rockchip Innosilicon hdmi phy")
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
index 4b936ca19920..620961fcfc1d 100644
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
@@ -1020,9 +1020,10 @@ inno_hdmi_phy_rk3328_power_on(struct inno_hdmi_phy *inno,
|
||||
|
||||
inno_write(inno, 0xac, RK3328_POST_PLL_FB_DIV_7_0(cfg->fbdiv));
|
||||
if (cfg->postdiv == 1) {
|
||||
- inno_write(inno, 0xaa, RK3328_POST_PLL_REFCLK_SEL_TMDS);
|
||||
inno_write(inno, 0xab, RK3328_POST_PLL_FB_DIV_8(cfg->fbdiv) |
|
||||
RK3328_POST_PLL_PRE_DIV(cfg->prediv));
|
||||
+ inno_write(inno, 0xaa, RK3328_POST_PLL_REFCLK_SEL_TMDS |
|
||||
+ RK3328_POST_PLL_POWER_DOWN);
|
||||
} else {
|
||||
v = (cfg->postdiv / 2) - 1;
|
||||
v &= RK3328_POST_PLL_POST_DIV_MASK;
|
||||
@@ -1030,7 +1031,8 @@ inno_hdmi_phy_rk3328_power_on(struct inno_hdmi_phy *inno,
|
||||
inno_write(inno, 0xab, RK3328_POST_PLL_FB_DIV_8(cfg->fbdiv) |
|
||||
RK3328_POST_PLL_PRE_DIV(cfg->prediv));
|
||||
inno_write(inno, 0xaa, RK3328_POST_PLL_POST_DIV_ENABLE |
|
||||
- RK3328_POST_PLL_REFCLK_SEL_TMDS);
|
||||
+ RK3328_POST_PLL_REFCLK_SEL_TMDS |
|
||||
+ RK3328_POST_PLL_POWER_DOWN);
|
||||
}
|
||||
|
||||
for (v = 0; v < 14; v++)
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Huicong Xu <xhc@rock-chips.com>
|
||||
Date: Sat, 10 Oct 2020 15:32:20 +0000
|
||||
Subject: [PATCH] phy/rockchip: inno-hdmi: force set_rate on power_on
|
||||
|
||||
Regular 8-bit and Deep Color video formats mainly differ in TMDS rate and
|
||||
not in pixel clock rate.
|
||||
When the hdmiphy clock is configured with the same pixel clock rate using
|
||||
clk_set_rate() the clock framework do not signal the hdmi phy driver
|
||||
to set_rate when switching between 8-bit and Deep Color.
|
||||
This result in pre/post pll not being re-configured when switching between
|
||||
regular 8-bit and Deep Color video formats.
|
||||
|
||||
Fix this by calling set_rate in power_on to force pre pll re-configuration.
|
||||
|
||||
Signed-off-by: Huicong Xu <xhc@rock-chips.com>
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
index 620961fcfc1d..2f01259823ea 100644
|
||||
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
|
||||
@@ -245,6 +245,7 @@ struct inno_hdmi_phy {
|
||||
struct clk_hw hw;
|
||||
struct clk *phyclk;
|
||||
unsigned long pixclock;
|
||||
+ unsigned long tmdsclock;
|
||||
};
|
||||
|
||||
struct pre_pll_config {
|
||||
@@ -485,6 +486,8 @@ static int inno_hdmi_phy_power_on(struct phy *phy)
|
||||
|
||||
dev_dbg(inno->dev, "Inno HDMI PHY Power On\n");
|
||||
|
||||
+ inno->plat_data->clk_ops->set_rate(&inno->hw, inno->pixclock, 24000000);
|
||||
+
|
||||
ret = clk_prepare_enable(inno->phyclk);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -509,6 +512,8 @@ static int inno_hdmi_phy_power_off(struct phy *phy)
|
||||
|
||||
clk_disable_unprepare(inno->phyclk);
|
||||
|
||||
+ inno->tmdsclock = 0;
|
||||
+
|
||||
dev_dbg(inno->dev, "Inno HDMI PHY Power Off\n");
|
||||
|
||||
return 0;
|
||||
@@ -628,6 +633,9 @@ static int inno_hdmi_phy_rk3228_clk_set_rate(struct clk_hw *hw,
|
||||
dev_dbg(inno->dev, "%s rate %lu tmdsclk %lu\n",
|
||||
__func__, rate, tmdsclock);
|
||||
|
||||
+ if (inno->pixclock == rate && inno->tmdsclock == tmdsclock)
|
||||
+ return 0;
|
||||
+
|
||||
cfg = inno_hdmi_phy_get_pre_pll_cfg(inno, rate);
|
||||
if (IS_ERR(cfg))
|
||||
return PTR_ERR(cfg);
|
||||
@@ -670,6 +678,7 @@ static int inno_hdmi_phy_rk3228_clk_set_rate(struct clk_hw *hw,
|
||||
}
|
||||
|
||||
inno->pixclock = rate;
|
||||
+ inno->tmdsclock = tmdsclock;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -781,6 +790,9 @@ static int inno_hdmi_phy_rk3328_clk_set_rate(struct clk_hw *hw,
|
||||
dev_dbg(inno->dev, "%s rate %lu tmdsclk %lu\n",
|
||||
__func__, rate, tmdsclock);
|
||||
|
||||
+ if (inno->pixclock == rate && inno->tmdsclock == tmdsclock)
|
||||
+ return 0;
|
||||
+
|
||||
cfg = inno_hdmi_phy_get_pre_pll_cfg(inno, rate);
|
||||
if (IS_ERR(cfg))
|
||||
return PTR_ERR(cfg);
|
||||
@@ -820,6 +832,7 @@ static int inno_hdmi_phy_rk3328_clk_set_rate(struct clk_hw *hw,
|
||||
}
|
||||
|
||||
inno->pixclock = rate;
|
||||
+ inno->tmdsclock = tmdsclock;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sun, 17 Feb 2019 22:14:38 +0000
|
||||
Subject: [PATCH] mmc: core: set initial signal voltage on power off
|
||||
|
||||
Some boards have SD card connectors where the power rail cannot be switched
|
||||
off by the driver. If the card has not been power cycled, it may still be
|
||||
using 1.8V signaling after a warm re-boot. Bootroms expecting 3.3V signaling
|
||||
will fail to boot from a UHS card that continue to use 1.8V signaling.
|
||||
|
||||
Set initial signal voltage in mmc_power_off() to allow re-boot to function.
|
||||
|
||||
This fixes re-boot with UHS cards on Asus Tinker Board (Rockchip RK3288),
|
||||
same issue have been seen on some Rockchip RK3399 boards.
|
||||
|
||||
I am sending this as a RFC because I have no insights into SD/MMC subsystem,
|
||||
this change fix a re-boot issue on my boards and does not break emmc/sdio.
|
||||
Is this an acceptable workaround? Any advice is appreciated.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/mmc/core/core.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
|
||||
index 95fedcf56e4a..38e75b275bb6 100644
|
||||
--- a/drivers/mmc/core/core.c
|
||||
+++ b/drivers/mmc/core/core.c
|
||||
@@ -1355,6 +1355,14 @@ void mmc_power_off(struct mmc_host *host)
|
||||
if (host->ios.power_mode == MMC_POWER_OFF)
|
||||
return;
|
||||
|
||||
+ mmc_set_initial_signal_voltage(host);
|
||||
+
|
||||
+ /*
|
||||
+ * This delay should be sufficient to allow the power supply
|
||||
+ * to reach the minimum voltage.
|
||||
+ */
|
||||
+ mmc_delay(host->ios.power_delay_ms);
|
||||
+
|
||||
mmc_pwrseq_power_off(host);
|
||||
|
||||
host->ios.clock = 0;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Wed, 23 Jun 2021 16:59:18 +0200
|
||||
Subject: [PATCH] arm64: dts: rockchip: Add sdmmc_ext for RK3328
|
||||
|
||||
RK3328 SoC has a fourth mmc controller called SDMMC_EXT. Some
|
||||
boards have sdio wifi connected to it. In order to use it
|
||||
one would have to add the pinctrls from sdmmc0ext group which
|
||||
is done on board level.
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
index 5b2020590f53..df46edbec82c 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
@@ -975,6 +975,20 @@ usb_host0_ohci: usb@ff5d0000 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ sdmmc_ext: mmc@ff5f0000 {
|
||||
+ compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
|
||||
+ reg = <0x0 0xff5f0000 0x0 0x4000>;
|
||||
+ interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&cru HCLK_SDMMC_EXT>, <&cru SCLK_SDMMC_EXT>,
|
||||
+ <&cru SCLK_SDMMC_EXT_DRV>, <&cru SCLK_SDMMC_EXT_SAMPLE>;
|
||||
+ clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
|
||||
+ fifo-depth = <0x100>;
|
||||
+ max-frequency = <150000000>;
|
||||
+ resets = <&cru SRST_SDMMCEXT>;
|
||||
+ reset-names = "reset";
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
usbdrd3: usb@ff600000 {
|
||||
compatible = "rockchip,rk3328-dwc3", "snps,dwc3";
|
||||
reg = <0x0 0xff600000 0x0 0x100000>;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Wed, 23 Jun 2021 17:02:08 +0200
|
||||
Subject: [PATCH] arm64: dts: rockchip: Add sdmmc/sdio/emmc reset controls for
|
||||
RK3328
|
||||
|
||||
The DW MCI controller driver will use them to reset the IP block before
|
||||
initialisation.
|
||||
|
||||
Fixes: d717f7352ec6 ("arm64: dts: rockchip: add sdmmc/sdio/emmc nodes for RK3328 SoCs")
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
index df46edbec82c..cfc57be009a6 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
@@ -853,6 +853,8 @@ sdmmc: mmc@ff500000 {
|
||||
clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
|
||||
fifo-depth = <0x100>;
|
||||
max-frequency = <150000000>;
|
||||
+ resets = <&cru SRST_MMC0>;
|
||||
+ reset-names = "reset";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -865,6 +867,8 @@ sdio: mmc@ff510000 {
|
||||
clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
|
||||
fifo-depth = <0x100>;
|
||||
max-frequency = <150000000>;
|
||||
+ resets = <&cru SRST_SDIO>;
|
||||
+ reset-names = "reset";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -877,6 +881,8 @@ emmc: mmc@ff520000 {
|
||||
clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
|
||||
fifo-depth = <0x100>;
|
||||
max-frequency = <150000000>;
|
||||
+ resets = <&cru SRST_EMMC>;
|
||||
+ reset-names = "reset";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Sat, 21 Aug 2021 19:13:31 +0200
|
||||
Subject: [PATCH] Commit a728c10dd62a ("arm64: dts: rockchip: remove
|
||||
interrupt-names from iommu nodes") intended to remove the interrupt-names
|
||||
property for the mmu nodes. It also removed them for the vpu node in
|
||||
rk3399.dtsi which currently results in a non-working driver. Fix this by
|
||||
re-adding them.
|
||||
|
||||
Fixes: a728c10dd62a ("arm64: dts: rockchip: remove interrupt-names from iommu nodes")
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
||||
index 9db9484ca38f..44def886b391 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
||||
@@ -1240,6 +1240,7 @@ vpu: video-codec@ff650000 {
|
||||
reg = <0x0 0xff650000 0x0 0x800>;
|
||||
interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
<GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
+ interrupt-names = "vepu", "vdpu";
|
||||
clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
|
||||
clock-names = "aclk", "hclk";
|
||||
iommus = <&vpu_mmu>;
|
||||
@@ -0,0 +1,735 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:33 +0000
|
||||
Subject: [PATCH] media: rkvdec: h264: Fix reference frame_num wrap for second
|
||||
field
|
||||
|
||||
When decoding the second field in a complementary field pair the second
|
||||
field is sharing the same frame_num with the first field.
|
||||
|
||||
Currently the frame_num for the first field is wrapped when it matches the
|
||||
field being decoded, this cause issues to decode the second field in a
|
||||
complementary field pair.
|
||||
|
||||
Fix this by using inclusive comparison, less than or equal.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec-h264.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
index 76e97cbe2512..af44a16c0c4a 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
@@ -752,7 +752,7 @@ static void assemble_hw_rps(struct rkvdec_ctx *ctx,
|
||||
continue;
|
||||
|
||||
if (dpb[i].flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM ||
|
||||
- dpb[i].frame_num < dec_params->frame_num) {
|
||||
+ dpb[i].frame_num <= dec_params->frame_num) {
|
||||
p[i] = dpb[i].frame_num;
|
||||
continue;
|
||||
}
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:34 +0000
|
||||
Subject: [PATCH] media: rkvdec: Ensure decoded resolution fit coded resolution
|
||||
|
||||
Ensure decoded CAPTURE buffer resolution is larger or equal to the coded
|
||||
OPTUPT buffer resolution.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
index 7131156c1f2c..65a8334a188b 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
@@ -233,6 +233,8 @@ static int rkvdec_try_capture_fmt(struct file *file, void *priv,
|
||||
pix_mp->pixelformat = coded_desc->decoded_fmts[0];
|
||||
|
||||
/* Always apply the frmsize constraint of the coded end. */
|
||||
+ pix_mp->width = max(pix_mp->width, ctx->coded_fmt.fmt.pix_mp.width);
|
||||
+ pix_mp->height = max(pix_mp->height, ctx->coded_fmt.fmt.pix_mp.height);
|
||||
v4l2_apply_frmsize_constraints(&pix_mp->width,
|
||||
&pix_mp->height,
|
||||
&coded_desc->frmsize);
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:34 +0000
|
||||
Subject: [PATCH] media: rkvdec: h264: Validate and use pic width and height in
|
||||
mbs
|
||||
|
||||
The width and height in mbs is currently configured based on OUTPUT buffer
|
||||
resolution, this works for frame pictures but can cause issues for field
|
||||
pictures.
|
||||
|
||||
When frame_mbs_only_flag is 0 the height in mbs should be height of
|
||||
the field instead of height of frame.
|
||||
|
||||
Validate pic_width_in_mbs_minus1 and pic_height_in_map_units_minus1
|
||||
against OUTPUT buffer resolution and use these values to configure HW.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec-h264.c | 4 ++--
|
||||
drivers/staging/media/rkvdec/rkvdec.c | 10 ++++++++++
|
||||
2 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
index af44a16c0c4a..9852c3519f56 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
@@ -671,8 +671,8 @@ static void assemble_hw_pps(struct rkvdec_ctx *ctx,
|
||||
LOG2_MAX_PIC_ORDER_CNT_LSB_MINUS4);
|
||||
WRITE_PPS(!!(sps->flags & V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO),
|
||||
DELTA_PIC_ORDER_ALWAYS_ZERO_FLAG);
|
||||
- WRITE_PPS(DIV_ROUND_UP(ctx->coded_fmt.fmt.pix_mp.width, 16), PIC_WIDTH_IN_MBS);
|
||||
- WRITE_PPS(DIV_ROUND_UP(ctx->coded_fmt.fmt.pix_mp.height, 16), PIC_HEIGHT_IN_MBS);
|
||||
+ WRITE_PPS(sps->pic_width_in_mbs_minus1 + 1, PIC_WIDTH_IN_MBS);
|
||||
+ WRITE_PPS(sps->pic_height_in_map_units_minus1 + 1, PIC_HEIGHT_IN_MBS);
|
||||
WRITE_PPS(!!(sps->flags & V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY),
|
||||
FRAME_MBS_ONLY_FLAG);
|
||||
WRITE_PPS(!!(sps->flags & V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD),
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
index 65a8334a188b..f4c5ee4a1e26 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
@@ -29,8 +29,11 @@
|
||||
|
||||
static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
+ struct rkvdec_ctx *ctx = container_of(ctrl->handler, struct rkvdec_ctx, ctrl_hdl);
|
||||
+
|
||||
if (ctrl->id == V4L2_CID_STATELESS_H264_SPS) {
|
||||
const struct v4l2_ctrl_h264_sps *sps = ctrl->p_new.p_h264_sps;
|
||||
+ unsigned int width, height;
|
||||
/*
|
||||
* TODO: The hardware supports 10-bit and 4:2:2 profiles,
|
||||
* but it's currently broken in the driver.
|
||||
@@ -45,6 +48,13 @@ static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
|
||||
if (sps->bit_depth_luma_minus8 != 0)
|
||||
/* Only 8-bit is supported */
|
||||
return -EINVAL;
|
||||
+
|
||||
+ width = (sps->pic_width_in_mbs_minus1 + 1) * 16;
|
||||
+ height = (sps->pic_height_in_map_units_minus1 + 1) * 16;
|
||||
+
|
||||
+ if (width > ctx->coded_fmt.fmt.pix_mp.width ||
|
||||
+ height > ctx->coded_fmt.fmt.pix_mp.height)
|
||||
+ return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:35 +0000
|
||||
Subject: [PATCH] media: rkvdec: h264: Fix bit depth wrap in pps packet
|
||||
|
||||
The luma and chroma bit depth fields in the pps packet is 3 bits wide.
|
||||
8 is wrongly added to the bit depth value written to these 3-bit fields.
|
||||
Because only the 3 LSB is written the hardware is configured correctly.
|
||||
|
||||
Correct this by not adding 8 to the luma and chroma bit depth value.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec-h264.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
index 9852c3519f56..f3ff3e709169 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
@@ -661,8 +661,8 @@ static void assemble_hw_pps(struct rkvdec_ctx *ctx,
|
||||
WRITE_PPS(0xff, PROFILE_IDC);
|
||||
WRITE_PPS(1, CONSTRAINT_SET3_FLAG);
|
||||
WRITE_PPS(sps->chroma_format_idc, CHROMA_FORMAT_IDC);
|
||||
- WRITE_PPS(sps->bit_depth_luma_minus8 + 8, BIT_DEPTH_LUMA);
|
||||
- WRITE_PPS(sps->bit_depth_chroma_minus8 + 8, BIT_DEPTH_CHROMA);
|
||||
+ WRITE_PPS(sps->bit_depth_luma_minus8, BIT_DEPTH_LUMA);
|
||||
+ WRITE_PPS(sps->bit_depth_chroma_minus8, BIT_DEPTH_CHROMA);
|
||||
WRITE_PPS(0, QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG);
|
||||
WRITE_PPS(sps->log2_max_frame_num_minus4, LOG2_MAX_FRAME_NUM_MINUS4);
|
||||
WRITE_PPS(sps->max_num_ref_frames, MAX_NUM_REF_FRAMES);
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:35 +0000
|
||||
Subject: [PATCH] media: v4l2-common: Add helpers to calculate bytesperline and
|
||||
sizeimage
|
||||
|
||||
Add helper functions to calculate plane bytesperline and sizeimage, these
|
||||
new helpers consider block width and height when calculating plane
|
||||
bytesperline and sizeimage.
|
||||
|
||||
This prepare support for new pixel formats added in next patch that make
|
||||
use of block width and height.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/media/v4l2-core/v4l2-common.c | 77 +++++++++++++--------------
|
||||
1 file changed, 38 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c
|
||||
index 04af03285a20..ae585828c388 100644
|
||||
--- a/drivers/media/v4l2-core/v4l2-common.c
|
||||
+++ b/drivers/media/v4l2-core/v4l2-common.c
|
||||
@@ -333,6 +333,33 @@ static inline unsigned int v4l2_format_block_height(const struct v4l2_format_inf
|
||||
return info->block_h[plane];
|
||||
}
|
||||
|
||||
+static inline unsigned int v4l2_format_plane_width(const struct v4l2_format_info *info, int plane,
|
||||
+ unsigned int width)
|
||||
+{
|
||||
+ unsigned int hdiv = plane ? info->hdiv : 1;
|
||||
+ unsigned int bytes = DIV_ROUND_UP(width * info->bpp[plane],
|
||||
+ v4l2_format_block_width(info, plane) *
|
||||
+ v4l2_format_block_height(info, plane));
|
||||
+
|
||||
+ return DIV_ROUND_UP(bytes, hdiv);
|
||||
+}
|
||||
+
|
||||
+static inline unsigned int v4l2_format_plane_height(const struct v4l2_format_info *info, int plane,
|
||||
+ unsigned int height)
|
||||
+{
|
||||
+ unsigned int vdiv = plane ? info->vdiv : 1;
|
||||
+ unsigned int lines = ALIGN(height, v4l2_format_block_height(info, plane));
|
||||
+
|
||||
+ return DIV_ROUND_UP(lines, vdiv);
|
||||
+}
|
||||
+
|
||||
+static inline unsigned int v4l2_format_plane_size(const struct v4l2_format_info *info, int plane,
|
||||
+ unsigned int width, unsigned int height)
|
||||
+{
|
||||
+ return v4l2_format_plane_width(info, plane, width) *
|
||||
+ v4l2_format_plane_height(info, plane, height);
|
||||
+}
|
||||
+
|
||||
void v4l2_apply_frmsize_constraints(u32 *width, u32 *height,
|
||||
const struct v4l2_frmsize_stepwise *frmsize)
|
||||
{
|
||||
@@ -368,37 +395,19 @@ int v4l2_fill_pixfmt_mp(struct v4l2_pix_format_mplane *pixfmt,
|
||||
|
||||
if (info->mem_planes == 1) {
|
||||
plane = &pixfmt->plane_fmt[0];
|
||||
- plane->bytesperline = ALIGN(width, v4l2_format_block_width(info, 0)) * info->bpp[0];
|
||||
+ plane->bytesperline = v4l2_format_plane_width(info, 0, width);
|
||||
plane->sizeimage = 0;
|
||||
|
||||
- for (i = 0; i < info->comp_planes; i++) {
|
||||
- unsigned int hdiv = (i == 0) ? 1 : info->hdiv;
|
||||
- unsigned int vdiv = (i == 0) ? 1 : info->vdiv;
|
||||
- unsigned int aligned_width;
|
||||
- unsigned int aligned_height;
|
||||
-
|
||||
- aligned_width = ALIGN(width, v4l2_format_block_width(info, i));
|
||||
- aligned_height = ALIGN(height, v4l2_format_block_height(info, i));
|
||||
-
|
||||
- plane->sizeimage += info->bpp[i] *
|
||||
- DIV_ROUND_UP(aligned_width, hdiv) *
|
||||
- DIV_ROUND_UP(aligned_height, vdiv);
|
||||
- }
|
||||
+ for (i = 0; i < info->comp_planes; i++)
|
||||
+ plane->sizeimage +=
|
||||
+ v4l2_format_plane_size(info, i, width, height);
|
||||
} else {
|
||||
for (i = 0; i < info->comp_planes; i++) {
|
||||
- unsigned int hdiv = (i == 0) ? 1 : info->hdiv;
|
||||
- unsigned int vdiv = (i == 0) ? 1 : info->vdiv;
|
||||
- unsigned int aligned_width;
|
||||
- unsigned int aligned_height;
|
||||
-
|
||||
- aligned_width = ALIGN(width, v4l2_format_block_width(info, i));
|
||||
- aligned_height = ALIGN(height, v4l2_format_block_height(info, i));
|
||||
-
|
||||
plane = &pixfmt->plane_fmt[i];
|
||||
plane->bytesperline =
|
||||
- info->bpp[i] * DIV_ROUND_UP(aligned_width, hdiv);
|
||||
- plane->sizeimage =
|
||||
- plane->bytesperline * DIV_ROUND_UP(aligned_height, vdiv);
|
||||
+ v4l2_format_plane_width(info, i, width);
|
||||
+ plane->sizeimage = plane->bytesperline *
|
||||
+ v4l2_format_plane_height(info, i, height);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -422,22 +431,12 @@ int v4l2_fill_pixfmt(struct v4l2_pix_format *pixfmt, u32 pixelformat,
|
||||
pixfmt->width = width;
|
||||
pixfmt->height = height;
|
||||
pixfmt->pixelformat = pixelformat;
|
||||
- pixfmt->bytesperline = ALIGN(width, v4l2_format_block_width(info, 0)) * info->bpp[0];
|
||||
+ pixfmt->bytesperline = v4l2_format_plane_width(info, 0, width);
|
||||
pixfmt->sizeimage = 0;
|
||||
|
||||
- for (i = 0; i < info->comp_planes; i++) {
|
||||
- unsigned int hdiv = (i == 0) ? 1 : info->hdiv;
|
||||
- unsigned int vdiv = (i == 0) ? 1 : info->vdiv;
|
||||
- unsigned int aligned_width;
|
||||
- unsigned int aligned_height;
|
||||
-
|
||||
- aligned_width = ALIGN(width, v4l2_format_block_width(info, i));
|
||||
- aligned_height = ALIGN(height, v4l2_format_block_height(info, i));
|
||||
-
|
||||
- pixfmt->sizeimage += info->bpp[i] *
|
||||
- DIV_ROUND_UP(aligned_width, hdiv) *
|
||||
- DIV_ROUND_UP(aligned_height, vdiv);
|
||||
- }
|
||||
+ for (i = 0; i < info->comp_planes; i++)
|
||||
+ pixfmt->sizeimage +=
|
||||
+ v4l2_format_plane_size(info, i, width, height);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(v4l2_fill_pixfmt);
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:36 +0000
|
||||
Subject: [PATCH] media: v4l2: Add NV15 and NV20 pixel formats
|
||||
|
||||
Add NV15 and NV20 pixel formats used by the Rockchip Video Decoder for
|
||||
10-bit buffers.
|
||||
|
||||
NV15 and NV20 is a packed 10-bit 4:2:0/4:2:2 semi-planar Y/CbCr format
|
||||
similar to P010 and P210 but has no padding between components. Instead,
|
||||
luminance and chrominance samples are grouped into 4s so that each group is
|
||||
packed into an integer number of bytes:
|
||||
|
||||
YYYY = UVUV = 4 * 10 bits = 40 bits = 5 bytes
|
||||
|
||||
The '15' and '20' suffix refers to the optimum effective bits per pixel
|
||||
which is achieved when the total number of luminance samples is a multiple
|
||||
of 8 for NV15 and 4 for NV20.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/media/v4l2-core/v4l2-common.c | 3 +++
|
||||
drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++
|
||||
include/uapi/linux/videodev2.h | 3 +++
|
||||
3 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c
|
||||
index ae585828c388..5bafbdbe30b0 100644
|
||||
--- a/drivers/media/v4l2-core/v4l2-common.c
|
||||
+++ b/drivers/media/v4l2-core/v4l2-common.c
|
||||
@@ -267,6 +267,9 @@ const struct v4l2_format_info *v4l2_format_info(u32 format)
|
||||
{ .format = V4L2_PIX_FMT_NV24, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 1, .vdiv = 1 },
|
||||
{ .format = V4L2_PIX_FMT_NV42, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 1, .vdiv = 1 },
|
||||
|
||||
+ { .format = V4L2_PIX_FMT_NV15, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 5, 5, 0, 0 }, .hdiv = 2, .vdiv = 2, .block_w = { 4, 2, 0, 0 }, .block_h = { 1, 1, 0, 0 } },
|
||||
+ { .format = V4L2_PIX_FMT_NV20, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 5, 5, 0, 0 }, .hdiv = 2, .vdiv = 1, .block_w = { 4, 2, 0, 0 }, .block_h = { 1, 1, 0, 0 } },
|
||||
+
|
||||
{ .format = V4L2_PIX_FMT_YUV410, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 4, .vdiv = 4 },
|
||||
{ .format = V4L2_PIX_FMT_YVU410, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 4, .vdiv = 4 },
|
||||
{ .format = V4L2_PIX_FMT_YUV411P, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 4, .vdiv = 1 },
|
||||
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
|
||||
index 9ac557b8e..0573d9a6a 100644
|
||||
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
|
||||
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
|
||||
@@ -1299,6 +1299,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
|
||||
case V4L2_PIX_FMT_NV61: descr = "Y/CrCb 4:2:2"; break;
|
||||
case V4L2_PIX_FMT_NV24: descr = "Y/CbCr 4:4:4"; break;
|
||||
case V4L2_PIX_FMT_NV42: descr = "Y/CrCb 4:4:4"; break;
|
||||
+ case V4L2_PIX_FMT_NV15: descr = "10-bit Y/CbCr 4:2:0 (Packed)"; break;
|
||||
+ case V4L2_PIX_FMT_NV20: descr = "10-bit Y/CbCr 4:2:2 (Packed)"; break;
|
||||
case V4L2_PIX_FMT_NV12_4L4: descr = "Y/CbCr 4:2:0 (4x4 Linear)"; break;
|
||||
case V4L2_PIX_FMT_NV12_16L16: descr = "Y/CbCr 4:2:0 (16x16 Linear)"; break;
|
||||
case V4L2_PIX_FMT_NV12_32L32: descr = "Y/CbCr 4:2:0 (32x32 Linear)"; break;
|
||||
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
|
||||
index 9260791b8438..169f8ad6fade 100644
|
||||
--- a/include/uapi/linux/videodev2.h
|
||||
+++ b/include/uapi/linux/videodev2.h
|
||||
@@ -603,6 +603,9 @@ struct v4l2_pix_format {
|
||||
#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
|
||||
#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
|
||||
|
||||
+#define V4L2_PIX_FMT_NV15 v4l2_fourcc('N', 'V', '1', '5') /* 15 Y/CbCr 4:2:0 10-bit packed */
|
||||
+#define V4L2_PIX_FMT_NV20 v4l2_fourcc('N', 'V', '2', '0') /* 20 Y/CbCr 4:2:2 10-bit packed */
|
||||
+
|
||||
/* two non contiguous planes - one Y, one Cr + Cb interleaved */
|
||||
#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
|
||||
#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:36 +0000
|
||||
Subject: [PATCH] media: rkvdec: h264: Use bytesperline and buffer height to
|
||||
calculate stride
|
||||
|
||||
Use bytesperline and buffer height to calculate the strides configured.
|
||||
|
||||
This does not really change anything other than ensuring the bytesperline
|
||||
that is signaled to userspace matches what is configured in HW.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec-h264.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
index 503ae683d0fd..88f5f4bb320b 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
@@ -893,9 +893,9 @@ static void config_registers(struct rkvdec_ctx *ctx,
|
||||
dma_addr_t rlc_addr;
|
||||
dma_addr_t refer_addr;
|
||||
u32 rlc_len;
|
||||
- u32 hor_virstride = 0;
|
||||
- u32 ver_virstride = 0;
|
||||
- u32 y_virstride = 0;
|
||||
+ u32 hor_virstride;
|
||||
+ u32 ver_virstride;
|
||||
+ u32 y_virstride;
|
||||
u32 yuv_virstride = 0;
|
||||
u32 offset;
|
||||
dma_addr_t dst_addr;
|
||||
@@ -906,8 +906,8 @@ static void config_registers(struct rkvdec_ctx *ctx,
|
||||
|
||||
f = &ctx->decoded_fmt;
|
||||
dst_fmt = &f->fmt.pix_mp;
|
||||
- hor_virstride = (sps->bit_depth_luma_minus8 + 8) * dst_fmt->width / 8;
|
||||
- ver_virstride = round_up(dst_fmt->height, 16);
|
||||
+ hor_virstride = dst_fmt->plane_fmt[0].bytesperline;
|
||||
+ ver_virstride = dst_fmt->height;
|
||||
y_virstride = hor_virstride * ver_virstride;
|
||||
|
||||
if (sps->chroma_format_idc == 0)
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:37 +0000
|
||||
Subject: [PATCH] media: rkvdec: Extract rkvdec_fill_decoded_pixfmt helper
|
||||
method
|
||||
|
||||
This extract setting decoded pixfmt into a helper method, current code is
|
||||
replaced with a call to the new helper method.
|
||||
|
||||
The helper method is also called from a new function in next patch.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec.c | 29 ++++++++++++++-------------
|
||||
1 file changed, 15 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
index f4c5ee4a1e26..d8d0eab9e25d 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
@@ -27,6 +27,17 @@
|
||||
#include "rkvdec.h"
|
||||
#include "rkvdec-regs.h"
|
||||
|
||||
+static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx,
|
||||
+ struct v4l2_pix_format_mplane *pix_mp)
|
||||
+{
|
||||
+ v4l2_fill_pixfmt_mp(pix_mp, pix_mp->pixelformat,
|
||||
+ pix_mp->width, pix_mp->height);
|
||||
+ pix_mp->plane_fmt[0].sizeimage += 128 *
|
||||
+ DIV_ROUND_UP(pix_mp->width, 16) *
|
||||
+ DIV_ROUND_UP(pix_mp->height, 16);
|
||||
+ pix_mp->field = V4L2_FIELD_NONE;
|
||||
+}
|
||||
+
|
||||
static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct rkvdec_ctx *ctx = container_of(ctrl->handler, struct rkvdec_ctx, ctrl_hdl);
|
||||
@@ -177,13 +188,9 @@ static void rkvdec_reset_decoded_fmt(struct rkvdec_ctx *ctx)
|
||||
|
||||
rkvdec_reset_fmt(ctx, f, ctx->coded_fmt_desc->decoded_fmts[0]);
|
||||
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
- v4l2_fill_pixfmt_mp(&f->fmt.pix_mp,
|
||||
- ctx->coded_fmt_desc->decoded_fmts[0],
|
||||
- ctx->coded_fmt.fmt.pix_mp.width,
|
||||
- ctx->coded_fmt.fmt.pix_mp.height);
|
||||
- f->fmt.pix_mp.plane_fmt[0].sizeimage += 128 *
|
||||
- DIV_ROUND_UP(f->fmt.pix_mp.width, 16) *
|
||||
- DIV_ROUND_UP(f->fmt.pix_mp.height, 16);
|
||||
+ f->fmt.pix_mp.width = ctx->coded_fmt.fmt.pix_mp.width;
|
||||
+ f->fmt.pix_mp.height = ctx->coded_fmt.fmt.pix_mp.height;
|
||||
+ rkvdec_fill_decoded_pixfmt(ctx, &f->fmt.pix_mp);
|
||||
}
|
||||
|
||||
static int rkvdec_enum_framesizes(struct file *file, void *priv,
|
||||
@@ -249,13 +256,7 @@ static int rkvdec_try_capture_fmt(struct file *file, void *priv,
|
||||
&pix_mp->height,
|
||||
&coded_desc->frmsize);
|
||||
|
||||
- v4l2_fill_pixfmt_mp(pix_mp, pix_mp->pixelformat,
|
||||
- pix_mp->width, pix_mp->height);
|
||||
- pix_mp->plane_fmt[0].sizeimage +=
|
||||
- 128 *
|
||||
- DIV_ROUND_UP(pix_mp->width, 16) *
|
||||
- DIV_ROUND_UP(pix_mp->height, 16);
|
||||
- pix_mp->field = V4L2_FIELD_NONE;
|
||||
+ rkvdec_fill_decoded_pixfmt(ctx, pix_mp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:37 +0000
|
||||
Subject: [PATCH] media: rkvdec: Lock capture pixel format in s_ctrl and s_fmt
|
||||
|
||||
Add an optional valid_fmt operation that should return the valid
|
||||
pixelformat of CAPTURE buffers.
|
||||
|
||||
This is used in next patch to ensure correct pixelformat is used for 10-bit
|
||||
and 4:2:2 content.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec.c | 59 ++++++++++++++++++++++++---
|
||||
drivers/staging/media/rkvdec/rkvdec.h | 2 +
|
||||
2 files changed, 55 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
index d8d0eab9e25d..d31344c4acaa 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
@@ -38,6 +38,16 @@ static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx,
|
||||
pix_mp->field = V4L2_FIELD_NONE;
|
||||
}
|
||||
|
||||
+static u32 rkvdec_valid_fmt(struct rkvdec_ctx *ctx, struct v4l2_ctrl *ctrl)
|
||||
+{
|
||||
+ const struct rkvdec_coded_fmt_desc *coded_desc = ctx->coded_fmt_desc;
|
||||
+
|
||||
+ if (coded_desc->ops->valid_fmt)
|
||||
+ return coded_desc->ops->valid_fmt(ctx, ctrl);
|
||||
+
|
||||
+ return ctx->valid_fmt;
|
||||
+}
|
||||
+
|
||||
static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct rkvdec_ctx *ctx = container_of(ctrl->handler, struct rkvdec_ctx, ctrl_hdl);
|
||||
@@ -60,6 +70,10 @@ static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
|
||||
/* Only 8-bit is supported */
|
||||
return -EINVAL;
|
||||
|
||||
+ if (ctx->valid_fmt && ctx->valid_fmt != rkvdec_valid_fmt(ctx, ctrl))
|
||||
+ /* Only current valid format */
|
||||
+ return -EINVAL;
|
||||
+
|
||||
width = (sps->pic_width_in_mbs_minus1 + 1) * 16;
|
||||
height = (sps->pic_height_in_map_units_minus1 + 1) * 16;
|
||||
|
||||
@@ -70,8 +84,27 @@ static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int rkvdec_s_ctrl(struct v4l2_ctrl *ctrl)
|
||||
+{
|
||||
+ struct rkvdec_ctx *ctx = container_of(ctrl->handler, struct rkvdec_ctx, ctrl_hdl);
|
||||
+
|
||||
+ if (ctrl->id == V4L2_CID_STATELESS_H264_SPS && !ctx->valid_fmt) {
|
||||
+ ctx->valid_fmt = rkvdec_valid_fmt(ctx, ctrl);
|
||||
+ if (ctx->valid_fmt) {
|
||||
+ struct v4l2_pix_format_mplane *pix_mp;
|
||||
+
|
||||
+ pix_mp = &ctx->decoded_fmt.fmt.pix_mp;
|
||||
+ pix_mp->pixelformat = ctx->valid_fmt;
|
||||
+ rkvdec_fill_decoded_pixfmt(ctx, pix_mp);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static const struct v4l2_ctrl_ops rkvdec_ctrl_ops = {
|
||||
.try_ctrl = rkvdec_try_ctrl,
|
||||
+ .s_ctrl = rkvdec_s_ctrl,
|
||||
};
|
||||
|
||||
static const struct rkvdec_ctrl_desc rkvdec_h264_ctrl_descs[] = {
|
||||
@@ -186,6 +219,7 @@ static void rkvdec_reset_decoded_fmt(struct rkvdec_ctx *ctx)
|
||||
{
|
||||
struct v4l2_format *f = &ctx->decoded_fmt;
|
||||
|
||||
+ ctx->valid_fmt = 0;
|
||||
rkvdec_reset_fmt(ctx, f, ctx->coded_fmt_desc->decoded_fmts[0]);
|
||||
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
||||
f->fmt.pix_mp.width = ctx->coded_fmt.fmt.pix_mp.width;
|
||||
@@ -241,13 +275,17 @@ static int rkvdec_try_capture_fmt(struct file *file, void *priv,
|
||||
if (WARN_ON(!coded_desc))
|
||||
return -EINVAL;
|
||||
|
||||
- for (i = 0; i < coded_desc->num_decoded_fmts; i++) {
|
||||
- if (coded_desc->decoded_fmts[i] == pix_mp->pixelformat)
|
||||
- break;
|
||||
- }
|
||||
+ if (ctx->valid_fmt) {
|
||||
+ pix_mp->pixelformat = ctx->valid_fmt;
|
||||
+ } else {
|
||||
+ for (i = 0; i < coded_desc->num_decoded_fmts; i++) {
|
||||
+ if (coded_desc->decoded_fmts[i] == pix_mp->pixelformat)
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
- if (i == coded_desc->num_decoded_fmts)
|
||||
- pix_mp->pixelformat = coded_desc->decoded_fmts[0];
|
||||
+ if (i == coded_desc->num_decoded_fmts)
|
||||
+ pix_mp->pixelformat = coded_desc->decoded_fmts[0];
|
||||
+ }
|
||||
|
||||
/* Always apply the frmsize constraint of the coded end. */
|
||||
pix_mp->width = max(pix_mp->width, ctx->coded_fmt.fmt.pix_mp.width);
|
||||
@@ -322,6 +360,7 @@ static int rkvdec_s_capture_fmt(struct file *file, void *priv,
|
||||
return ret;
|
||||
|
||||
ctx->decoded_fmt = *f;
|
||||
+ ctx->valid_fmt = f->fmt.pix_mp.pixelformat;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -411,6 +450,14 @@ static int rkvdec_enum_capture_fmt(struct file *file, void *priv,
|
||||
if (WARN_ON(!ctx->coded_fmt_desc))
|
||||
return -EINVAL;
|
||||
|
||||
+ if (ctx->valid_fmt) {
|
||||
+ if (f->index)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ f->pixelformat = ctx->valid_fmt;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (f->index >= ctx->coded_fmt_desc->num_decoded_fmts)
|
||||
return -EINVAL;
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec.h b/drivers/staging/media/rkvdec/rkvdec.h
|
||||
index 52ac3874c5e5..7b6f44ee8a1a 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec.h
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec.h
|
||||
@@ -62,6 +62,7 @@ vb2_to_rkvdec_decoded_buf(struct vb2_buffer *buf)
|
||||
struct rkvdec_coded_fmt_ops {
|
||||
int (*adjust_fmt)(struct rkvdec_ctx *ctx,
|
||||
struct v4l2_format *f);
|
||||
+ u32 (*valid_fmt)(struct rkvdec_ctx *ctx, struct v4l2_ctrl *ctrl);
|
||||
int (*start)(struct rkvdec_ctx *ctx);
|
||||
void (*stop)(struct rkvdec_ctx *ctx);
|
||||
int (*run)(struct rkvdec_ctx *ctx);
|
||||
@@ -95,6 +96,7 @@ struct rkvdec_ctx {
|
||||
struct v4l2_fh fh;
|
||||
struct v4l2_format coded_fmt;
|
||||
struct v4l2_format decoded_fmt;
|
||||
+ u32 valid_fmt;
|
||||
const struct rkvdec_coded_fmt_desc *coded_fmt_desc;
|
||||
struct v4l2_ctrl_handler ctrl_hdl;
|
||||
struct rkvdec_dev *dev;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 21:54:37 +0000
|
||||
Subject: [PATCH] media: rkvdec: h264: Support High 10 and 4:2:2 profiles
|
||||
|
||||
Add support and enable decoding of H264 High 10 and 4:2:2 profiles.
|
||||
|
||||
Decoded CAPTURE buffer width is aligned to 64 pixels to accommodate HW
|
||||
requirement on 10-bit format buffers.
|
||||
|
||||
The new valid_fmt operation is implemented and return a valid pixelformat
|
||||
for the provided SPS control.
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
---
|
||||
drivers/staging/media/rkvdec/rkvdec-h264.c | 20 ++++++++++++++++++++
|
||||
drivers/staging/media/rkvdec/rkvdec.c | 19 +++++++++----------
|
||||
2 files changed, 29 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
index 88f5f4bb320b..c9a551dbd9bc 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec-h264.c
|
||||
@@ -1021,6 +1021,25 @@ static int rkvdec_h264_adjust_fmt(struct rkvdec_ctx *ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static u32 rkvdec_h264_valid_fmt(struct rkvdec_ctx *ctx, struct v4l2_ctrl *ctrl)
|
||||
+{
|
||||
+ const struct v4l2_ctrl_h264_sps *sps = ctrl->p_new.p_h264_sps;
|
||||
+
|
||||
+ if (sps->bit_depth_luma_minus8 == 0) {
|
||||
+ if (sps->chroma_format_idc == 2)
|
||||
+ return V4L2_PIX_FMT_NV16;
|
||||
+ else
|
||||
+ return V4L2_PIX_FMT_NV12;
|
||||
+ } else if (sps->bit_depth_luma_minus8 == 2) {
|
||||
+ if (sps->chroma_format_idc == 2)
|
||||
+ return V4L2_PIX_FMT_NV20;
|
||||
+ else
|
||||
+ return V4L2_PIX_FMT_NV15;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int rkvdec_h264_start(struct rkvdec_ctx *ctx)
|
||||
{
|
||||
struct rkvdec_dev *rkvdec = ctx->dev;
|
||||
@@ -1124,6 +1143,7 @@ static int rkvdec_h264_run(struct rkvdec_ctx *ctx)
|
||||
|
||||
const struct rkvdec_coded_fmt_ops rkvdec_h264_fmt_ops = {
|
||||
.adjust_fmt = rkvdec_h264_adjust_fmt,
|
||||
+ .valid_fmt = rkvdec_h264_valid_fmt,
|
||||
.start = rkvdec_h264_start,
|
||||
.stop = rkvdec_h264_stop,
|
||||
.run = rkvdec_h264_run,
|
||||
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
index d31344c4acaa..d068383aeea8 100644
|
||||
--- a/drivers/staging/media/rkvdec/rkvdec.c
|
||||
+++ b/drivers/staging/media/rkvdec/rkvdec.c
|
||||
@@ -31,7 +31,7 @@ static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx,
|
||||
struct v4l2_pix_format_mplane *pix_mp)
|
||||
{
|
||||
v4l2_fill_pixfmt_mp(pix_mp, pix_mp->pixelformat,
|
||||
- pix_mp->width, pix_mp->height);
|
||||
+ ALIGN(pix_mp->width, 64), pix_mp->height);
|
||||
pix_mp->plane_fmt[0].sizeimage += 128 *
|
||||
DIV_ROUND_UP(pix_mp->width, 16) *
|
||||
DIV_ROUND_UP(pix_mp->height, 16);
|
||||
@@ -55,19 +55,15 @@ static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
|
||||
if (ctrl->id == V4L2_CID_STATELESS_H264_SPS) {
|
||||
const struct v4l2_ctrl_h264_sps *sps = ctrl->p_new.p_h264_sps;
|
||||
unsigned int width, height;
|
||||
- /*
|
||||
- * TODO: The hardware supports 10-bit and 4:2:2 profiles,
|
||||
- * but it's currently broken in the driver.
|
||||
- * Reject them for now, until it's fixed.
|
||||
- */
|
||||
- if (sps->chroma_format_idc > 1)
|
||||
- /* Only 4:0:0 and 4:2:0 are supported */
|
||||
+
|
||||
+ if (sps->chroma_format_idc > 2)
|
||||
+ /* Only 4:0:0, 4:2:0 and 4:2:2 are supported */
|
||||
return -EINVAL;
|
||||
if (sps->bit_depth_luma_minus8 != sps->bit_depth_chroma_minus8)
|
||||
/* Luma and chroma bit depth mismatch */
|
||||
return -EINVAL;
|
||||
- if (sps->bit_depth_luma_minus8 != 0)
|
||||
- /* Only 8-bit is supported */
|
||||
+ if (sps->bit_depth_luma_minus8 != 0 && sps->bit_depth_luma_minus8 != 2)
|
||||
+ /* Only 8-bit and 10-bit is supported */
|
||||
return -EINVAL;
|
||||
|
||||
if (ctx->valid_fmt && ctx->valid_fmt != rkvdec_valid_fmt(ctx, ctrl))
|
||||
@@ -155,6 +151,9 @@ static const struct rkvdec_ctrls rkvdec_h264_ctrls = {
|
||||
|
||||
static const u32 rkvdec_h264_decoded_fmts[] = {
|
||||
V4L2_PIX_FMT_NV12,
|
||||
+ V4L2_PIX_FMT_NV15,
|
||||
+ V4L2_PIX_FMT_NV16,
|
||||
+ V4L2_PIX_FMT_NV20,
|
||||
};
|
||||
|
||||
static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = {
|
||||
|
||||
@@ -0,0 +1,531 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 22:30:13 +0000
|
||||
Subject: [PATCH] drm: drm_fourcc: add NV20 and NV30 YUV formats
|
||||
|
||||
DRM_FORMAT_NV20 and DRM_FORMAT_NV30 formats is the 2x1 and non-subsampled
|
||||
variant of NV15, a 10-bit 2-plane YUV format that has no padding between
|
||||
components. Instead, luminance and chrominance samples are grouped into 4s
|
||||
so that each group is packed into an integer number of bytes:
|
||||
|
||||
YYYY = UVUV = 4 * 10 bits = 40 bits = 5 bytes
|
||||
|
||||
The '20' and '30' suffix refers to the optimum effective bits per pixel
|
||||
which is achieved when the total number of luminance samples is a multiple
|
||||
of 4.
|
||||
|
||||
V2: Added NV30 format
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
Reviewed-by: Sandy Huang <hjc@rock-chips.com>
|
||||
---
|
||||
drivers/gpu/drm/drm_fourcc.c | 8 ++++++++
|
||||
include/uapi/drm/drm_fourcc.h | 2 ++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
|
||||
index eda832f9200d..9498e9d466fb 100644
|
||||
--- a/drivers/gpu/drm/drm_fourcc.c
|
||||
+++ b/drivers/gpu/drm/drm_fourcc.c
|
||||
@@ -258,6 +258,14 @@ const struct drm_format_info *__drm_format_info(u32 format)
|
||||
.num_planes = 2, .char_per_block = { 5, 5, 0 },
|
||||
.block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2,
|
||||
.vsub = 2, .is_yuv = true },
|
||||
+ { .format = DRM_FORMAT_NV20, .depth = 0,
|
||||
+ .num_planes = 2, .char_per_block = { 5, 5, 0 },
|
||||
+ .block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2,
|
||||
+ .vsub = 1, .is_yuv = true },
|
||||
+ { .format = DRM_FORMAT_NV30, .depth = 0,
|
||||
+ .num_planes = 2, .char_per_block = { 5, 5, 0 },
|
||||
+ .block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 1,
|
||||
+ .vsub = 1, .is_yuv = true },
|
||||
{ .format = DRM_FORMAT_Q410, .depth = 0,
|
||||
.num_planes = 3, .char_per_block = { 2, 2, 2 },
|
||||
.block_w = { 1, 1, 1 }, .block_h = { 1, 1, 1 }, .hsub = 0,
|
||||
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
|
||||
index f7156322aba5..a30bb7ef7632 100644
|
||||
--- a/include/uapi/drm/drm_fourcc.h
|
||||
+++ b/include/uapi/drm/drm_fourcc.h
|
||||
@@ -279,6 +279,8 @@ extern "C" {
|
||||
* index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian
|
||||
*/
|
||||
#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */
|
||||
+#define DRM_FORMAT_NV20 fourcc_code('N', 'V', '2', '0') /* 2x1 subsampled Cr:Cb plane */
|
||||
+#define DRM_FORMAT_NV30 fourcc_code('N', 'V', '3', '0') /* non-subsampled Cr:Cb plane */
|
||||
|
||||
/*
|
||||
* 2 plane YCbCr MSB aligned
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Mon, 6 Jul 2020 22:30:13 +0000
|
||||
Subject: [PATCH] drm: rockchip: add NV15, NV20 and NV30 support
|
||||
|
||||
Add support for displaying 10-bit 4:2:0 and 4:2:2 formats produced by the
|
||||
Rockchip Video Decoder on RK322X, RK3288, RK3328, RK3368 and RK3399.
|
||||
Also add support for 10-bit 4:4:4 format while at it.
|
||||
|
||||
V2: Added NV30 support
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
Reviewed-by: Sandy Huang <hjc@rock-chips.com>
|
||||
---
|
||||
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 29 +++++++++++++++++--
|
||||
drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 1 +
|
||||
drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 32 +++++++++++++++++----
|
||||
3 files changed, 54 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
||||
index f5b9028a16a3..9df4a271f3aa 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
||||
@@ -262,6 +262,18 @@ static bool has_rb_swapped(uint32_t format)
|
||||
}
|
||||
}
|
||||
|
||||
+static bool is_fmt_10(uint32_t format)
|
||||
+{
|
||||
+ switch (format) {
|
||||
+ case DRM_FORMAT_NV15:
|
||||
+ case DRM_FORMAT_NV20:
|
||||
+ case DRM_FORMAT_NV30:
|
||||
+ return true;
|
||||
+ default:
|
||||
+ return false;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static enum vop_data_format vop_convert_format(uint32_t format)
|
||||
{
|
||||
switch (format) {
|
||||
@@ -277,10 +289,13 @@ static enum vop_data_format vop_convert_format(uint32_t format)
|
||||
case DRM_FORMAT_BGR565:
|
||||
return VOP_FMT_RGB565;
|
||||
case DRM_FORMAT_NV12:
|
||||
+ case DRM_FORMAT_NV15:
|
||||
return VOP_FMT_YUV420SP;
|
||||
case DRM_FORMAT_NV16:
|
||||
+ case DRM_FORMAT_NV20:
|
||||
return VOP_FMT_YUV422SP;
|
||||
case DRM_FORMAT_NV24:
|
||||
+ case DRM_FORMAT_NV30:
|
||||
return VOP_FMT_YUV444SP;
|
||||
default:
|
||||
DRM_ERROR("unsupported format[%08x]\n", format);
|
||||
@@ -931,7 +946,12 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
|
||||
dsp_sty = dest->y1 + crtc->mode.vtotal - crtc->mode.vsync_start;
|
||||
dsp_st = dsp_sty << 16 | (dsp_stx & 0xffff);
|
||||
|
||||
- offset = (src->x1 >> 16) * fb->format->cpp[0];
|
||||
+ if (fb->format->block_w[0])
|
||||
+ offset = (src->x1 >> 16) * fb->format->char_per_block[0] /
|
||||
+ fb->format->block_w[0];
|
||||
+ else
|
||||
+ offset = (src->x1 >> 16) * fb->format->cpp[0];
|
||||
+
|
||||
offset += (src->y1 >> 16) * fb->pitches[0];
|
||||
dma_addr = rk_obj->dma_addr + offset + fb->offsets[0];
|
||||
|
||||
@@ -957,6 +977,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
|
||||
}
|
||||
|
||||
VOP_WIN_SET(vop, win, format, format);
|
||||
+ VOP_WIN_SET(vop, win, fmt_10, is_fmt_10(fb->format->format));
|
||||
VOP_WIN_SET(vop, win, yrgb_vir, DIV_ROUND_UP(fb->pitches[0], 4));
|
||||
VOP_WIN_SET(vop, win, yrgb_mst, dma_addr);
|
||||
VOP_WIN_YUV2YUV_SET(vop, win_yuv2yuv, y2r_en, is_yuv);
|
||||
@@ -973,7 +994,11 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
|
||||
uv_obj = fb->obj[1];
|
||||
rk_uv_obj = to_rockchip_obj(uv_obj);
|
||||
|
||||
- offset = (src->x1 >> 16) * bpp / hsub;
|
||||
+ if (fb->format->block_w[1])
|
||||
+ offset = (src->x1 >> 16) * bpp /
|
||||
+ fb->format->block_w[1] / hsub;
|
||||
+ else
|
||||
+ offset = (src->x1 >> 16) * bpp / hsub;
|
||||
offset += (src->y1 >> 16) * fb->pitches[1] / vsub;
|
||||
|
||||
dma_addr = rk_uv_obj->dma_addr + offset + fb->offsets[1];
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
||||
index 857d97cdc67c..b7169010622a 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h
|
||||
@@ -165,6 +165,7 @@ struct vop_win_phy {
|
||||
struct vop_reg enable;
|
||||
struct vop_reg gate;
|
||||
struct vop_reg format;
|
||||
+ struct vop_reg fmt_10;
|
||||
struct vop_reg rb_swap;
|
||||
struct vop_reg act_info;
|
||||
struct vop_reg dsp_info;
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
||||
index ca7cc82125cb..fff9c3387b9d 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
|
||||
@@ -50,6 +50,23 @@ static const uint32_t formats_win_full[] = {
|
||||
DRM_FORMAT_NV24,
|
||||
};
|
||||
|
||||
+static const uint32_t formats_win_full_10[] = {
|
||||
+ DRM_FORMAT_XRGB8888,
|
||||
+ DRM_FORMAT_ARGB8888,
|
||||
+ DRM_FORMAT_XBGR8888,
|
||||
+ DRM_FORMAT_ABGR8888,
|
||||
+ DRM_FORMAT_RGB888,
|
||||
+ DRM_FORMAT_BGR888,
|
||||
+ DRM_FORMAT_RGB565,
|
||||
+ DRM_FORMAT_BGR565,
|
||||
+ DRM_FORMAT_NV12,
|
||||
+ DRM_FORMAT_NV16,
|
||||
+ DRM_FORMAT_NV24,
|
||||
+ DRM_FORMAT_NV15,
|
||||
+ DRM_FORMAT_NV20,
|
||||
+ DRM_FORMAT_NV30,
|
||||
+};
|
||||
+
|
||||
static const uint64_t format_modifiers_win_full[] = {
|
||||
DRM_FORMAT_MOD_LINEAR,
|
||||
DRM_FORMAT_MOD_INVALID,
|
||||
@@ -613,11 +630,12 @@ static const struct vop_scl_regs rk3288_win_full_scl = {
|
||||
|
||||
static const struct vop_win_phy rk3288_win01_data = {
|
||||
.scl = &rk3288_win_full_scl,
|
||||
- .data_formats = formats_win_full,
|
||||
- .nformats = ARRAY_SIZE(formats_win_full),
|
||||
+ .data_formats = formats_win_full_10,
|
||||
+ .nformats = ARRAY_SIZE(formats_win_full_10),
|
||||
.format_modifiers = format_modifiers_win_full,
|
||||
.enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0),
|
||||
.format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1),
|
||||
+ .fmt_10 = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 4),
|
||||
.rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12),
|
||||
.act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0),
|
||||
.dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0),
|
||||
@@ -747,11 +765,12 @@ static const struct vop_intr rk3368_vop_intr = {
|
||||
|
||||
static const struct vop_win_phy rk3368_win01_data = {
|
||||
.scl = &rk3288_win_full_scl,
|
||||
- .data_formats = formats_win_full,
|
||||
- .nformats = ARRAY_SIZE(formats_win_full),
|
||||
+ .data_formats = formats_win_full_10,
|
||||
+ .nformats = ARRAY_SIZE(formats_win_full_10),
|
||||
.format_modifiers = format_modifiers_win_full,
|
||||
.enable = VOP_REG(RK3368_WIN0_CTRL0, 0x1, 0),
|
||||
.format = VOP_REG(RK3368_WIN0_CTRL0, 0x7, 1),
|
||||
+ .fmt_10 = VOP_REG(RK3368_WIN0_CTRL0, 0x1, 4),
|
||||
.rb_swap = VOP_REG(RK3368_WIN0_CTRL0, 0x1, 12),
|
||||
.x_mir_en = VOP_REG(RK3368_WIN0_CTRL0, 0x1, 21),
|
||||
.y_mir_en = VOP_REG(RK3368_WIN0_CTRL0, 0x1, 22),
|
||||
@@ -896,11 +915,12 @@ static const struct vop_win_yuv2yuv_data rk3399_vop_big_win_yuv2yuv_data[] = {
|
||||
|
||||
static const struct vop_win_phy rk3399_win01_data = {
|
||||
.scl = &rk3288_win_full_scl,
|
||||
- .data_formats = formats_win_full,
|
||||
- .nformats = ARRAY_SIZE(formats_win_full),
|
||||
+ .data_formats = formats_win_full_10,
|
||||
+ .nformats = ARRAY_SIZE(formats_win_full_10),
|
||||
.format_modifiers = format_modifiers_win_full_afbc,
|
||||
.enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0),
|
||||
.format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1),
|
||||
+ .fmt_10 = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 4),
|
||||
.rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12),
|
||||
.y_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 22),
|
||||
.act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0),
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Qinglang Miao <miaoqinglang@huawei.com>
|
||||
Date: Tue, 1 Dec 2020 20:54:57 +0800
|
||||
Subject: [PATCH] drm/rockchip: cdn-dp: fix reference leak when
|
||||
pm_runtime_get_sync fails
|
||||
|
||||
The PM reference count is not expected to be incremented on
|
||||
return in cdn_dp_clk_enable.
|
||||
|
||||
However, pm_runtime_get_sync will increment the PM reference
|
||||
count even failed. Forgetting to putting operation will result
|
||||
in a reference leak here.
|
||||
|
||||
Replace it with pm_runtime_resume_and_get to keep usage
|
||||
counter balanced.
|
||||
|
||||
Fixes: efe0220fc2d2 ("drm/rockchip: cdn-dp: Fix error handling")
|
||||
Reported-by: Hulk Robot <hulkci@huawei.com>
|
||||
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
|
||||
---
|
||||
drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
|
||||
index 8ab3247dbc4a..8429c6706ec5 100644
|
||||
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
|
||||
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
|
||||
@@ -100,7 +100,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp)
|
||||
goto err_core_clk;
|
||||
}
|
||||
|
||||
- ret = pm_runtime_get_sync(dp->dev);
|
||||
+ ret = pm_runtime_resume_and_get(dp->dev);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret);
|
||||
goto err_pm_runtime_get;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Qinglang Miao <miaoqinglang@huawei.com>
|
||||
Date: Tue, 1 Dec 2020 20:54:58 +0800
|
||||
Subject: [PATCH] drm/rockchip: vop: fix reference leak when
|
||||
pm_runtime_get_sync fails
|
||||
|
||||
The PM reference count is not expected to be incremented on
|
||||
return in functions vop_enable and vop_enable.
|
||||
|
||||
However, pm_runtime_get_sync will increment the PM reference
|
||||
count even failed. Forgetting to putting operation will result
|
||||
in a reference leak here.
|
||||
|
||||
Replace it with pm_runtime_resume_and_get to keep usage
|
||||
counter balanced.
|
||||
|
||||
Fixes: 5e570373c015 ("drm/rockchip: vop: Enable pm domain before vop_initial")
|
||||
Reported-by: Hulk Robot <hulkci@huawei.com>
|
||||
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
|
||||
---
|
||||
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
||||
index 9df4a271f3aa..c3c0de25b8e6 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
|
||||
@@ -603,7 +603,7 @@ static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
|
||||
struct vop *vop = to_vop(crtc);
|
||||
int ret, i;
|
||||
|
||||
- ret = pm_runtime_get_sync(vop->dev);
|
||||
+ ret = pm_runtime_resume_and_get(vop->dev);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(vop->dev, "failed to get pm runtime: %d\n", ret);
|
||||
return ret;
|
||||
@@ -1956,7 +1956,7 @@ static int vop_initial(struct vop *vop)
|
||||
return PTR_ERR(vop->dclk);
|
||||
}
|
||||
|
||||
- ret = pm_runtime_get_sync(vop->dev);
|
||||
+ ret = pm_runtime_resume_and_get(vop->dev);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(vop->dev, "failed to get pm runtime: %d\n", ret);
|
||||
return ret;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Qinglang Miao <miaoqinglang@huawei.com>
|
||||
Date: Tue, 1 Dec 2020 20:54:59 +0800
|
||||
Subject: [PATCH] drm/rockchip: lvds: fix reference leak when
|
||||
pm_runtime_get_sync fails
|
||||
|
||||
The PM reference count is not expected to be incremented on
|
||||
return in functions rk3288_lvds_poweron and px30_lvds_poweron.
|
||||
|
||||
However, pm_runtime_get_sync will increment the PM reference
|
||||
count even failed. Forgetting to putting operation will result
|
||||
in a reference leak here.
|
||||
|
||||
Replace it with pm_runtime_resume_and_get to keep usage
|
||||
counter balanced.
|
||||
|
||||
Fixes: cca1705c3d89 ("drm/rockchip: lvds: Add PX30 support")
|
||||
Reported-by: Hulk Robot <hulkci@huawei.com>
|
||||
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
|
||||
---
|
||||
drivers/gpu/drm/rockchip/rockchip_lvds.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c
|
||||
index 489d63c05c0d..aaf0b6bbcb85 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_lvds.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c
|
||||
@@ -145,7 +145,7 @@ static int rk3288_lvds_poweron(struct rockchip_lvds *lvds)
|
||||
DRM_DEV_ERROR(lvds->dev, "failed to enable lvds pclk %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
- ret = pm_runtime_get_sync(lvds->dev);
|
||||
+ ret = pm_runtime_resume_and_get(lvds->dev);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(lvds->dev, "failed to get pm runtime: %d\n", ret);
|
||||
clk_disable(lvds->pclk);
|
||||
@@ -329,7 +329,7 @@ static int px30_lvds_poweron(struct rockchip_lvds *lvds)
|
||||
{
|
||||
int ret;
|
||||
|
||||
- ret = pm_runtime_get_sync(lvds->dev);
|
||||
+ ret = pm_runtime_resume_and_get(lvds->dev);
|
||||
if (ret < 0) {
|
||||
DRM_DEV_ERROR(lvds->dev, "failed to get pm runtime: %d\n", ret);
|
||||
return ret;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Date: Thu, 24 Jun 2021 11:55:02 +0200
|
||||
Subject: [PATCH] drm/rockchip: Implement mmap as GEM object function
|
||||
|
||||
Moving the driver-specific mmap code into a GEM object function allows
|
||||
for using DRM helpers for various mmap callbacks.
|
||||
|
||||
The respective rockchip functions are being removed. The file_operations
|
||||
structure fops is now being created by the helper macro
|
||||
DEFINE_DRM_GEM_FOPS().
|
||||
|
||||
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Tested-by: Heiko Stuebner <heiko@sntech.de>
|
||||
---
|
||||
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 13 +-----
|
||||
drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c | 3 +-
|
||||
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 44 +++++--------------
|
||||
drivers/gpu/drm/rockchip/rockchip_drm_gem.h | 7 ---
|
||||
4 files changed, 15 insertions(+), 52 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
|
||||
index b730b8d5d949..2e3ab573a817 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
|
||||
@@ -208,16 +208,7 @@ static void rockchip_drm_unbind(struct device *dev)
|
||||
drm_dev_put(drm_dev);
|
||||
}
|
||||
|
||||
-static const struct file_operations rockchip_drm_driver_fops = {
|
||||
- .owner = THIS_MODULE,
|
||||
- .open = drm_open,
|
||||
- .mmap = rockchip_gem_mmap,
|
||||
- .poll = drm_poll,
|
||||
- .read = drm_read,
|
||||
- .unlocked_ioctl = drm_ioctl,
|
||||
- .compat_ioctl = drm_compat_ioctl,
|
||||
- .release = drm_release,
|
||||
-};
|
||||
+DEFINE_DRM_GEM_FOPS(rockchip_drm_driver_fops);
|
||||
|
||||
static const struct drm_driver rockchip_drm_driver = {
|
||||
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
|
||||
@@ -226,7 +217,7 @@ static const struct drm_driver rockchip_drm_driver = {
|
||||
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
|
||||
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
|
||||
.gem_prime_import_sg_table = rockchip_gem_prime_import_sg_table,
|
||||
- .gem_prime_mmap = rockchip_gem_mmap_buf,
|
||||
+ .gem_prime_mmap = drm_gem_prime_mmap,
|
||||
.fops = &rockchip_drm_driver_fops,
|
||||
.name = DRIVER_NAME,
|
||||
.desc = DRIVER_DESC,
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c b/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
|
||||
index 2fdc455c4ad7..d8418dd39d0e 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <drm/drm.h>
|
||||
#include <drm/drm_fb_helper.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
+#include <drm/drm_prime.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include "rockchip_drm_drv.h"
|
||||
@@ -24,7 +25,7 @@ static int rockchip_fbdev_mmap(struct fb_info *info,
|
||||
struct drm_fb_helper *helper = info->par;
|
||||
struct rockchip_drm_private *private = to_drm_private(helper);
|
||||
|
||||
- return rockchip_gem_mmap_buf(private->fbdev_bo, vma);
|
||||
+ return drm_gem_prime_mmap(private->fbdev_bo, vma);
|
||||
}
|
||||
|
||||
static const struct fb_ops rockchip_drm_fbdev_ops = {
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
|
||||
index 7971f57436dd..63eb73b624aa 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
|
||||
@@ -240,12 +240,22 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
|
||||
int ret;
|
||||
struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj);
|
||||
|
||||
+ /*
|
||||
+ * Set vm_pgoff (used as a fake buffer offset by DRM) to 0 and map the
|
||||
+ * whole buffer from the start.
|
||||
+ */
|
||||
+ vma->vm_pgoff = 0;
|
||||
+
|
||||
/*
|
||||
* We allocated a struct page table for rk_obj, so clear
|
||||
* VM_PFNMAP flag that was set by drm_gem_mmap_obj()/drm_gem_mmap().
|
||||
*/
|
||||
+ vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
|
||||
vma->vm_flags &= ~VM_PFNMAP;
|
||||
|
||||
+ vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
|
||||
+ vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
|
||||
+
|
||||
if (rk_obj->pages)
|
||||
ret = rockchip_drm_gem_object_mmap_iommu(obj, vma);
|
||||
else
|
||||
@@ -257,39 +267,6 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
|
||||
return ret;
|
||||
}
|
||||
|
||||
-int rockchip_gem_mmap_buf(struct drm_gem_object *obj,
|
||||
- struct vm_area_struct *vma)
|
||||
-{
|
||||
- int ret;
|
||||
-
|
||||
- ret = drm_gem_mmap_obj(obj, obj->size, vma);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- return rockchip_drm_gem_object_mmap(obj, vma);
|
||||
-}
|
||||
-
|
||||
-/* drm driver mmap file operations */
|
||||
-int rockchip_gem_mmap(struct file *filp, struct vm_area_struct *vma)
|
||||
-{
|
||||
- struct drm_gem_object *obj;
|
||||
- int ret;
|
||||
-
|
||||
- ret = drm_gem_mmap(filp, vma);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- /*
|
||||
- * Set vm_pgoff (used as a fake buffer offset by DRM) to 0 and map the
|
||||
- * whole buffer from the start.
|
||||
- */
|
||||
- vma->vm_pgoff = 0;
|
||||
-
|
||||
- obj = vma->vm_private_data;
|
||||
-
|
||||
- return rockchip_drm_gem_object_mmap(obj, vma);
|
||||
-}
|
||||
-
|
||||
static void rockchip_gem_release_object(struct rockchip_gem_object *rk_obj)
|
||||
{
|
||||
drm_gem_object_release(&rk_obj->base);
|
||||
@@ -301,6 +278,7 @@ static const struct drm_gem_object_funcs rockchip_gem_object_funcs = {
|
||||
.get_sg_table = rockchip_gem_prime_get_sg_table,
|
||||
.vmap = rockchip_gem_prime_vmap,
|
||||
.vunmap = rockchip_gem_prime_vunmap,
|
||||
+ .mmap = rockchip_drm_gem_object_mmap,
|
||||
.vm_ops = &drm_gem_cma_vm_ops,
|
||||
};
|
||||
|
||||
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
|
||||
index 5a70a56cd406..47c1861eece0 100644
|
||||
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
|
||||
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.h
|
||||
@@ -34,13 +34,6 @@ rockchip_gem_prime_import_sg_table(struct drm_device *dev,
|
||||
int rockchip_gem_prime_vmap(struct drm_gem_object *obj, struct dma_buf_map *map);
|
||||
void rockchip_gem_prime_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map);
|
||||
|
||||
-/* drm driver mmap file operations */
|
||||
-int rockchip_gem_mmap(struct file *filp, struct vm_area_struct *vma);
|
||||
-
|
||||
-/* mmap a gem object to userspace. */
|
||||
-int rockchip_gem_mmap_buf(struct drm_gem_object *obj,
|
||||
- struct vm_area_struct *vma);
|
||||
-
|
||||
struct rockchip_gem_object *
|
||||
rockchip_gem_create_object(struct drm_device *drm, unsigned int size,
|
||||
bool alloc_kmap);
|
||||
|
||||
3499
patch/kernel/archive/rockchip-5.17/01-linux-1000-drm-rockchip.patch
Normal file
3499
patch/kernel/archive/rockchip-5.17/01-linux-1000-drm-rockchip.patch
Normal file
File diff suppressed because it is too large
Load Diff
1023
patch/kernel/archive/rockchip-5.17/01-linux-1001-v4l2-rockchip.patch
Normal file
1023
patch/kernel/archive/rockchip-5.17/01-linux-1001-v4l2-rockchip.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,647 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Wed, 2 Sep 2020 19:52:02 +0200
|
||||
Subject: [PATCH] arm64: dts: rockchip: add gpu powerdomain, gpu opp-table and
|
||||
cooling cell for RK3328
|
||||
|
||||
Note: since the regulator that supplies the GPU usually also supplies
|
||||
other SoC components, we have to make sure voltage is never lower then
|
||||
1075 mV.
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 34 ++++++++++++++++++++++++
|
||||
1 file changed, 34 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
index 23021373e15b..ca03c8ed9708 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
|
||||
@@ -300,6 +300,11 @@ power: power-controller {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
+ power-domain@RK3328_PD_GPU {
|
||||
+ reg = <RK3328_PD_GPU>;
|
||||
+ clocks = <&cru ACLK_GPU>;
|
||||
+ #power-domain-cells = <0>;
|
||||
+ };
|
||||
power-domain@RK3328_PD_HEVC {
|
||||
reg = <RK3328_PD_HEVC>;
|
||||
#power-domain-cells = <0>;
|
||||
@@ -539,6 +544,11 @@ map0 {
|
||||
<&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
||||
contribution = <4096>;
|
||||
};
|
||||
+ map1 {
|
||||
+ trip = <&target>;
|
||||
+ cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
||||
+ contribution = <4096>;
|
||||
+ };
|
||||
};
|
||||
};
|
||||
|
||||
@@ -620,7 +630,31 @@ gpu: gpu@ff300000 {
|
||||
"ppmmu1";
|
||||
clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>;
|
||||
clock-names = "bus", "core";
|
||||
+ operating-points-v2 = <&gpu_opp_table>;
|
||||
+ power-domains = <&power RK3328_PD_GPU>;
|
||||
resets = <&cru SRST_GPU_A>;
|
||||
+ #cooling-cells = <2>;
|
||||
+ };
|
||||
+
|
||||
+ gpu_opp_table: gpu-opp-table {
|
||||
+ compatible = "operating-points-v2";
|
||||
+
|
||||
+ opp-200000000 {
|
||||
+ opp-hz = /bits/ 64 <200000000>;
|
||||
+ opp-microvolt = <1075000>;
|
||||
+ };
|
||||
+ opp-300000000 {
|
||||
+ opp-hz = /bits/ 64 <300000000>;
|
||||
+ opp-microvolt = <1075000>;
|
||||
+ };
|
||||
+ opp-400000000 {
|
||||
+ opp-hz = /bits/ 64 <400000000>;
|
||||
+ opp-microvolt = <1075000>;
|
||||
+ };
|
||||
+ opp-500000000 {
|
||||
+ opp-hz = /bits/ 64 <500000000>;
|
||||
+ opp-microvolt = <1150000>;
|
||||
+ };
|
||||
};
|
||||
|
||||
h265e_mmu: iommu@ff330200 {
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Tue, 2 Feb 2021 17:22:21 +0200
|
||||
Subject: [PATCH] ARM: dts: RK3288 miqi add hdmi sound nodes
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-miqi.dts | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
index 713f55e143c6..8d30c49f406e 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
@@ -78,6 +78,21 @@ vcc_sys: vsys-regulator {
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
};
|
||||
+
|
||||
+ sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,format = "i2s";
|
||||
+ simple-audio-card,name = "HDMI";
|
||||
+ simple-audio-card,mclk-fs = <512>;
|
||||
+
|
||||
+ simple-audio-card,codec {
|
||||
+ sound-dai = <&hdmi>;
|
||||
+ };
|
||||
+
|
||||
+ simple-audio-card,cpu {
|
||||
+ sound-dai = <&i2s>;
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&cpu0 {
|
||||
@@ -284,6 +299,11 @@ &i2c5 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&i2s {
|
||||
+ #sound-dai-cells = <0>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&io_domains {
|
||||
status = "okay";
|
||||
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Fri, 2 Apr 2021 17:54:22 +0200
|
||||
Subject: [PATCH] ARM/arm64: dts: rockchip: align sound card names
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-tinker.dtsi | 2 +-
|
||||
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
index 9c1e38c54eae..ee332fc9cf1f 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
@@ -75,7 +75,7 @@ sdio_pwrseq: sdio-pwrseq {
|
||||
sound {
|
||||
compatible = "simple-audio-card";
|
||||
simple-audio-card,format = "i2s";
|
||||
- simple-audio-card,name = "rockchip,tinker-codec";
|
||||
+ simple-audio-card,name = "HDMI";
|
||||
simple-audio-card,mclk-fs = <512>;
|
||||
|
||||
simple-audio-card,codec {
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
||||
index ec3561d147d5..b2ed593a229c 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
||||
@@ -1807,7 +1807,7 @@ hdmi_sound: hdmi-sound {
|
||||
compatible = "simple-audio-card";
|
||||
simple-audio-card,format = "i2s";
|
||||
simple-audio-card,mclk-fs = <256>;
|
||||
- simple-audio-card,name = "hdmi-sound";
|
||||
+ simple-audio-card,name = "HDMI";
|
||||
status = "disabled";
|
||||
|
||||
simple-audio-card,cpu {
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Wed, 10 Feb 2021 18:44:56 +0200
|
||||
Subject: [PATCH] HACK: drm/gem: suppress warning about missing vm_flags
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/drm_gem.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
|
||||
index d62fb1a3c916..e46165bed006 100644
|
||||
--- a/drivers/gpu/drm/drm_gem.c
|
||||
+++ b/drivers/gpu/drm/drm_gem.c
|
||||
@@ -1073,7 +1073,7 @@ int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
|
||||
ret = obj->funcs->mmap(obj, vma);
|
||||
if (ret)
|
||||
goto err_drm_gem_object_put;
|
||||
- WARN_ON(!(vma->vm_flags & VM_DONTEXPAND));
|
||||
+ //WARN_ON(!(vma->vm_flags & VM_DONTEXPAND));
|
||||
} else {
|
||||
if (!vma->vm_ops) {
|
||||
ret = -EINVAL;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sun, 25 Mar 2018 22:17:06 +0200
|
||||
Subject: [PATCH] ASoC: hdmi-codec: fix channel allocation
|
||||
|
||||
---
|
||||
sound/soc/codecs/hdmi-codec.c | 113 ++++++++++++++++------------------
|
||||
1 file changed, 52 insertions(+), 61 deletions(-)
|
||||
|
||||
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
|
||||
index b61f980cabdc..3ad50ae8c93d 100644
|
||||
--- a/sound/soc/codecs/hdmi-codec.c
|
||||
+++ b/sound/soc/codecs/hdmi-codec.c
|
||||
@@ -194,78 +194,69 @@ static const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = {
|
||||
*/
|
||||
static const struct hdmi_codec_cea_spk_alloc hdmi_codec_channel_alloc[] = {
|
||||
{ .ca_id = 0x00, .n_ch = 2,
|
||||
- .mask = FL | FR},
|
||||
- /* 2.1 */
|
||||
- { .ca_id = 0x01, .n_ch = 4,
|
||||
- .mask = FL | FR | LFE},
|
||||
- /* Dolby Surround */
|
||||
+ .mask = FL | FR },
|
||||
+ { .ca_id = 0x03, .n_ch = 4,
|
||||
+ .mask = FL | FR | LFE | FC },
|
||||
{ .ca_id = 0x02, .n_ch = 4,
|
||||
.mask = FL | FR | FC },
|
||||
- /* surround51 */
|
||||
+ { .ca_id = 0x01, .n_ch = 4,
|
||||
+ .mask = FL | FR | LFE },
|
||||
{ .ca_id = 0x0b, .n_ch = 6,
|
||||
- .mask = FL | FR | LFE | FC | RL | RR},
|
||||
- /* surround40 */
|
||||
- { .ca_id = 0x08, .n_ch = 6,
|
||||
- .mask = FL | FR | RL | RR },
|
||||
- /* surround41 */
|
||||
- { .ca_id = 0x09, .n_ch = 6,
|
||||
- .mask = FL | FR | LFE | RL | RR },
|
||||
- /* surround50 */
|
||||
+ .mask = FL | FR | LFE | FC | RL | RR },
|
||||
{ .ca_id = 0x0a, .n_ch = 6,
|
||||
.mask = FL | FR | FC | RL | RR },
|
||||
- /* 6.1 */
|
||||
- { .ca_id = 0x0f, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | FC | RL | RR | RC },
|
||||
- /* surround71 */
|
||||
+ { .ca_id = 0x09, .n_ch = 6,
|
||||
+ .mask = FL | FR | LFE | RL | RR },
|
||||
+ { .ca_id = 0x08, .n_ch = 6,
|
||||
+ .mask = FL | FR | RL | RR },
|
||||
+ { .ca_id = 0x07, .n_ch = 6,
|
||||
+ .mask = FL | FR | LFE | FC | RC },
|
||||
+ { .ca_id = 0x06, .n_ch = 6,
|
||||
+ .mask = FL | FR | FC | RC },
|
||||
+ { .ca_id = 0x05, .n_ch = 6,
|
||||
+ .mask = FL | FR | LFE | RC },
|
||||
+ { .ca_id = 0x04, .n_ch = 6,
|
||||
+ .mask = FL | FR | RC },
|
||||
{ .ca_id = 0x13, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | FC | RL | RR | RLC | RRC },
|
||||
- /* others */
|
||||
- { .ca_id = 0x03, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | FC },
|
||||
- { .ca_id = 0x04, .n_ch = 8,
|
||||
- .mask = FL | FR | RC},
|
||||
- { .ca_id = 0x05, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | RC },
|
||||
- { .ca_id = 0x06, .n_ch = 8,
|
||||
- .mask = FL | FR | FC | RC },
|
||||
- { .ca_id = 0x07, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | FC | RC },
|
||||
- { .ca_id = 0x0c, .n_ch = 8,
|
||||
- .mask = FL | FR | RC | RL | RR },
|
||||
- { .ca_id = 0x0d, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | RL | RR | RC },
|
||||
- { .ca_id = 0x0e, .n_ch = 8,
|
||||
- .mask = FL | FR | FC | RL | RR | RC },
|
||||
- { .ca_id = 0x10, .n_ch = 8,
|
||||
- .mask = FL | FR | RL | RR | RLC | RRC },
|
||||
- { .ca_id = 0x11, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | RL | RR | RLC | RRC },
|
||||
+ { .ca_id = 0x1f, .n_ch = 8,
|
||||
+ .mask = FL | FR | LFE | FC | RL | RR | FLC | FRC },
|
||||
{ .ca_id = 0x12, .n_ch = 8,
|
||||
.mask = FL | FR | FC | RL | RR | RLC | RRC },
|
||||
- { .ca_id = 0x14, .n_ch = 8,
|
||||
- .mask = FL | FR | FLC | FRC },
|
||||
- { .ca_id = 0x15, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | FLC | FRC },
|
||||
- { .ca_id = 0x16, .n_ch = 8,
|
||||
- .mask = FL | FR | FC | FLC | FRC },
|
||||
- { .ca_id = 0x17, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | FC | FLC | FRC },
|
||||
- { .ca_id = 0x18, .n_ch = 8,
|
||||
- .mask = FL | FR | RC | FLC | FRC },
|
||||
- { .ca_id = 0x19, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | RC | FLC | FRC },
|
||||
- { .ca_id = 0x1a, .n_ch = 8,
|
||||
- .mask = FL | FR | RC | FC | FLC | FRC },
|
||||
- { .ca_id = 0x1b, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | RC | FC | FLC | FRC },
|
||||
- { .ca_id = 0x1c, .n_ch = 8,
|
||||
- .mask = FL | FR | RL | RR | FLC | FRC },
|
||||
- { .ca_id = 0x1d, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | RL | RR | FLC | FRC },
|
||||
{ .ca_id = 0x1e, .n_ch = 8,
|
||||
.mask = FL | FR | FC | RL | RR | FLC | FRC },
|
||||
- { .ca_id = 0x1f, .n_ch = 8,
|
||||
- .mask = FL | FR | LFE | FC | RL | RR | FLC | FRC },
|
||||
+ { .ca_id = 0x11, .n_ch = 8,
|
||||
+ .mask = FL | FR | LFE | RL | RR | RLC | RRC },
|
||||
+ { .ca_id = 0x1d, .n_ch = 8,
|
||||
+ .mask = FL | FR | LFE | RL | RR | FLC | FRC },
|
||||
+ { .ca_id = 0x10, .n_ch = 8,
|
||||
+ .mask = FL | FR | RL | RR | RLC | RRC },
|
||||
+ { .ca_id = 0x1c, .n_ch = 8,
|
||||
+ .mask = FL | FR | RL | RR | FLC | FRC },
|
||||
+ { .ca_id = 0x0f, .n_ch = 8,
|
||||
+ .mask = FL | FR | LFE | FC | RL | RR | RC },
|
||||
+ { .ca_id = 0x1b, .n_ch = 8,
|
||||
+ .mask = FL | FR | LFE | RC | FC | FLC | FRC },
|
||||
+ { .ca_id = 0x0e, .n_ch = 8,
|
||||
+ .mask = FL | FR | FC | RL | RR | RC },
|
||||
+ { .ca_id = 0x1a, .n_ch = 8,
|
||||
+ .mask = FL | FR | RC | FC | FLC | FRC },
|
||||
+ { .ca_id = 0x0d, .n_ch = 8,
|
||||
+ .mask = FL | FR | LFE | RL | RR | RC },
|
||||
+ { .ca_id = 0x19, .n_ch = 8,
|
||||
+ .mask = FL | FR | LFE | RC | FLC | FRC },
|
||||
+ { .ca_id = 0x0c, .n_ch = 8,
|
||||
+ .mask = FL | FR | RC | RL | RR },
|
||||
+ { .ca_id = 0x18, .n_ch = 8,
|
||||
+ .mask = FL | FR | RC | FLC | FRC },
|
||||
+ { .ca_id = 0x17, .n_ch = 8,
|
||||
+ .mask = FL | FR | LFE | FC | FLC | FRC },
|
||||
+ { .ca_id = 0x16, .n_ch = 8,
|
||||
+ .mask = FL | FR | FC | FLC | FRC },
|
||||
+ { .ca_id = 0x15, .n_ch = 8,
|
||||
+ .mask = FL | FR | LFE | FLC | FRC },
|
||||
+ { .ca_id = 0x14, .n_ch = 8,
|
||||
+ .mask = FL | FR | FLC | FRC },
|
||||
};
|
||||
|
||||
struct hdmi_codec_priv {
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Sun, 2 May 2021 20:44:21 +0200
|
||||
Subject: [PATCH] arm64: dts: rockchip: Fix gmac delays for rockpro64 board
|
||||
|
||||
Values are measured by RK's delayline tool in vendor kernel
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi
|
||||
index 83db4ca67334..06d2a1e3e340 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi
|
||||
@@ -289,8 +289,8 @@ &gmac {
|
||||
snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
|
||||
snps,reset-active-low;
|
||||
snps,reset-delays-us = <0 10000 50000>;
|
||||
- tx_delay = <0x28>;
|
||||
- rx_delay = <0x11>;
|
||||
+ tx_delay = <0x23>;
|
||||
+ rx_delay = <0x1e>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Sat, 27 Feb 2021 17:52:02 +0100
|
||||
Subject: [PATCH] arm64: dts: rockchip: add SPDIF nodes for RK3328 A1 board
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3328-a1.dts | 23 ++++++++++++++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
||||
index de2d3e88e27f..68b74ed080f3 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
||||
@@ -57,6 +57,24 @@ ir-receiver {
|
||||
gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
|
||||
linux,rc-map-name = "rc-beelink-gs1";
|
||||
};
|
||||
+
|
||||
+ spdif_sound: spdif-sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,name = "SPDIF";
|
||||
+
|
||||
+ simple-audio-card,cpu {
|
||||
+ sound-dai = <&spdif>;
|
||||
+ };
|
||||
+
|
||||
+ simple-audio-card,codec {
|
||||
+ sound-dai = <&spdif_dit>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ spdif_dit: spdif-dit {
|
||||
+ compatible = "linux,spdif-dit";
|
||||
+ #sound-dai-cells = <0>;
|
||||
+ };
|
||||
};
|
||||
|
||||
&analog_sound {
|
||||
@@ -324,6 +342,11 @@ &sdmmc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&spdif {
|
||||
+ pinctrl-0 = <&spdifm0_tx>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&tsadc {
|
||||
rockchip,hw-tshut-mode = <0>;
|
||||
rockchip,hw-tshut-polarity = <0>;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Sat, 27 Feb 2021 18:01:13 +0100
|
||||
Subject: [PATCH] arm64: dts: rockchip: Add ir-receiver node for RK3328 ROC CC
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
|
||||
index aa22a0c22265..a78fbddd21df 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
|
||||
@@ -88,6 +88,13 @@ vcc_phy: vcc-phy-regulator {
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
+ ir-receiver {
|
||||
+ compatible = "gpio-ir-receiver";
|
||||
+ gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
|
||||
+ pinctrl-0 = <&ir_int>;
|
||||
+ pinctrl-names = "default";
|
||||
+ };
|
||||
+
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
@@ -308,6 +315,13 @@ &io_domains {
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
+
|
||||
+ ir {
|
||||
+ ir_int: ir-int {
|
||||
+ rockchip,pins = <2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
pmic {
|
||||
pmic_int_l: pmic-int-l {
|
||||
rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Mon, 1 Mar 2021 21:24:15 +0100
|
||||
Subject: [PATCH] ARM: dts: add cec pinctrl for RK3288 miqi board
|
||||
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-miqi.dts | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
index 8d30c49f406e..6d90db5a3b75 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
@@ -145,6 +145,8 @@ &gpu {
|
||||
|
||||
&hdmi {
|
||||
ddc-i2c-bus = <&i2c5>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&hdmi_cec_c0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Mon, 1 Mar 2021 19:22:15 +0100
|
||||
Subject: [PATCH] HACK: arm64: dts: enable FE phy for Beelink A1 also
|
||||
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3328-a1.dts | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
||||
index 68b74ed080f3..6736b5dc53e4 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
||||
@@ -147,6 +147,14 @@ rtl8211f: ethernet-phy@0 {
|
||||
};
|
||||
};
|
||||
|
||||
+&gmac2phy {
|
||||
+ clock_in_out = "output";
|
||||
+ assigned-clock-rate = <50000000>;
|
||||
+ assigned-clocks = <&cru SCLK_MAC2PHY>;
|
||||
+ assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&gpu {
|
||||
mali-supply = <&vdd_logic>;
|
||||
};
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Tue, 26 Feb 2019 20:45:14 +0000
|
||||
Subject: [PATCH] WIP: dw-hdmi-cec: sleep 100ms on error
|
||||
|
||||
---
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 18 ++++++++++++++++--
|
||||
1 file changed, 16 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
|
||||
index 70ab4fbdc23e..bf54bc70624f 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
|
||||
@@ -4,6 +4,7 @@
|
||||
*
|
||||
* Copyright (C) 2015-2017 Russell King.
|
||||
*/
|
||||
+#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
@@ -129,8 +130,15 @@ static irqreturn_t dw_hdmi_cec_hardirq(int irq, void *data)
|
||||
|
||||
dw_hdmi_write(cec, stat, HDMI_IH_CEC_STAT0);
|
||||
|
||||
- if (stat & CEC_STAT_ERROR_INIT) {
|
||||
- cec->tx_status = CEC_TX_STATUS_ERROR;
|
||||
+ /* Status with both done and error_initiator bits have been seen
|
||||
+ * on Rockchip RK3328 devices, transmit attempt seems to have failed
|
||||
+ * when this happens, report as low drive and block cec-framework
|
||||
+ * 100ms before core retransmits the failed message, this seems to
|
||||
+ * mitigate the issue with failed transmit attempts.
|
||||
+ */
|
||||
+ if ((stat & (CEC_STAT_DONE|CEC_STAT_ERROR_INIT)) == (CEC_STAT_DONE|CEC_STAT_ERROR_INIT)) {
|
||||
+ pr_debug("dw_hdmi_cec_hardirq: stat=%02x LOW_DRIVE\n", stat);
|
||||
+ cec->tx_status = CEC_TX_STATUS_LOW_DRIVE;
|
||||
cec->tx_done = true;
|
||||
ret = IRQ_WAKE_THREAD;
|
||||
} else if (stat & CEC_STAT_DONE) {
|
||||
@@ -141,6 +149,10 @@ static irqreturn_t dw_hdmi_cec_hardirq(int irq, void *data)
|
||||
cec->tx_status = CEC_TX_STATUS_NACK;
|
||||
cec->tx_done = true;
|
||||
ret = IRQ_WAKE_THREAD;
|
||||
+ } else if (stat & CEC_STAT_ERROR_INIT) {
|
||||
+ cec->tx_status = CEC_TX_STATUS_ERROR;
|
||||
+ cec->tx_done = true;
|
||||
+ ret = IRQ_WAKE_THREAD;
|
||||
}
|
||||
|
||||
if (stat & CEC_STAT_EOM) {
|
||||
@@ -173,6 +185,8 @@ static irqreturn_t dw_hdmi_cec_thread(int irq, void *data)
|
||||
|
||||
if (cec->tx_done) {
|
||||
cec->tx_done = false;
|
||||
+ if (cec->tx_status == CEC_TX_STATUS_LOW_DRIVE)
|
||||
+ msleep(100);
|
||||
cec_transmit_attempt_done(adap, cec->tx_status);
|
||||
}
|
||||
if (cec->rx_done) {
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Wed, 5 May 2021 19:11:12 +0200
|
||||
Subject: [PATCH] arm64: boot: dts: Increase ACLK_PERILP0 clock rate for RK3399
|
||||
|
||||
As per vendor kernel. Leaving this clock at the lower rate will
|
||||
result in poor DMA controller performance
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
||||
index b2ed593a229c..27938ff0d208 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
|
||||
@@ -1393,7 +1393,7 @@ cru: clock-controller@ff760000 {
|
||||
<1000000000>,
|
||||
<150000000>, <75000000>,
|
||||
<37500000>,
|
||||
- <100000000>, <100000000>,
|
||||
+ <300000000>, <100000000>,
|
||||
<50000000>, <600000000>,
|
||||
<100000000>, <50000000>,
|
||||
<400000000>, <400000000>,
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Sat, 21 Aug 2021 17:04:46 +0200
|
||||
Subject: [PATCH] arm64: dts: rockchip: Enable USB3 for rk3328 Beelink A1
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3328-a1.dts | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
||||
index 6736b5dc53e4..9000fae2a5ee 100644
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts
|
||||
@@ -388,6 +388,11 @@ &usb_host0_ehci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&usbdrd3 {
|
||||
+ dr_mode = "host";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&vop {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Bee <knaerzche@gmail.com>
|
||||
Date: Sat, 21 Aug 2021 14:03:25 +0200
|
||||
Subject: [PATCH] HACK: media: hantro: rockchip: disable H264 for RK3328
|
||||
|
||||
Signed-off-by: Alex Bee <knaerzche@gmail.com>
|
||||
---
|
||||
drivers/staging/media/hantro/rockchip_vpu_hw.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/staging/media/hantro/rockchip_vpu_hw.c b/drivers/staging/media/hantro/rockchip_vpu_hw.c
|
||||
index 3d98e2251ea5..b201700ccc8a 100644
|
||||
--- a/drivers/staging/media/hantro/rockchip_vpu_hw.c
|
||||
+++ b/drivers/staging/media/hantro/rockchip_vpu_hw.c
|
||||
@@ -530,8 +530,7 @@ const struct hantro_variant rk3328_vpu_variant = {
|
||||
.dec_offset = 0x400,
|
||||
.dec_fmts = rk3399_vpu_dec_fmts,
|
||||
.num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
|
||||
- .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
|
||||
- HANTRO_H264_DECODER,
|
||||
+ .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER,
|
||||
.codec_ops = rk3399_vpu_codec_ops,
|
||||
.irqs = rockchip_vdpu2_irqs,
|
||||
.num_irqs = ARRAY_SIZE(rockchip_vdpu2_irqs),
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
||||
Patches act8846 regulator providing the proper reset handle and exploit
|
||||
the SIPC bit in GLB_POWER_OFF register. Mainly used to reset some rockchip
|
||||
boards.
|
||||
|
||||
Origin: <https://patchwork.kernel.org/patch/6409521/>
|
||||
|
||||
diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
|
||||
index 2ff73d7..836d10b 100644
|
||||
--- a/drivers/regulator/act8865-regulator.c
|
||||
+++ b/drivers/regulator/act8865-regulator.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <linux/regulator/of_regulator.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <dt-bindings/regulator/active-semi,8865-regulator.h>
|
||||
+#include <linux/reboot.h>
|
||||
|
||||
/*
|
||||
* ACT8600 Global Register Map.
|
||||
@@ -133,6 +134,8 @@
|
||||
#define ACT8865_VOLTAGE_NUM 64
|
||||
#define ACT8600_SUDCDC_VOLTAGE_NUM 255
|
||||
|
||||
+#define ACT8846_SIPC_MASK 0x01
|
||||
+
|
||||
struct act8865 {
|
||||
struct regmap *regmap;
|
||||
int off_reg;
|
||||
@@ -402,6 +405,22 @@ static void act8865_power_off(void)
|
||||
while (1);
|
||||
}
|
||||
|
||||
+static int act8846_power_cycle(struct notifier_block *this,
|
||||
+ unsigned long code, void *unused)
|
||||
+{
|
||||
+ struct act8865 *act8846;
|
||||
+
|
||||
+ act8846 = i2c_get_clientdata(act8865_i2c_client);
|
||||
+ regmap_write(act8846->regmap, ACT8846_GLB_OFF_CTRL, ACT8846_SIPC_MASK);
|
||||
+
|
||||
+ return NOTIFY_DONE;
|
||||
+}
|
||||
+
|
||||
+static struct notifier_block act8846_restart_handler = {
|
||||
+ .notifier_call = act8846_power_cycle,
|
||||
+ .priority = 129,
|
||||
+};
|
||||
+
|
||||
static int act8865_pmic_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *i2c_id)
|
||||
{
|
||||
@@ -484,6 +503,8 @@ static int act8865_pmic_probe(struct i2c_client *client,
|
||||
}
|
||||
|
||||
if (of_device_is_system_power_controller(dev->of_node)) {
|
||||
+ int ret;
|
||||
+
|
||||
if (!pm_power_off && (off_reg > 0)) {
|
||||
act8865_i2c_client = client;
|
||||
act8865->off_reg = off_reg;
|
||||
@@ -492,6 +513,14 @@ static int act8865_pmic_probe(struct i2c_client *client,
|
||||
} else {
|
||||
dev_err(dev, "Failed to set poweroff capability, already defined\n");
|
||||
}
|
||||
+
|
||||
+ if (type == ACT8846) {
|
||||
+ act8865_i2c_client = client;
|
||||
+ ret = register_restart_handler(&act8846_restart_handler);
|
||||
+ if (ret)
|
||||
+ pr_err("%s: cannot register restart handler, %d\n",
|
||||
+ __func__, ret);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Finally register devices */
|
||||
@@ -0,0 +1,35 @@
|
||||
From 604ea7fc311af2b3a41e7fe3b4fbde0ee03dfb9c Mon Sep 17 00:00:00 2001
|
||||
From: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
Date: Thu, 19 Oct 2017 21:09:50 +0200
|
||||
Subject: [PATCH 04/28] dts: rk3288: miqi: Enabling the Mali GPU node
|
||||
|
||||
Why is the MiQi the only one left without a working mali GPU node ?
|
||||
|
||||
Seriously, is there a rk3288 chipset WITHOUT a mali GPU ? Couldn't
|
||||
they enable it once in the DTSI, instead of defining it as "disabled"
|
||||
and enabling it in every DTS file ?
|
||||
|
||||
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-miqi.dts | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
index 4d923aa6..3cd60674 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
@@ -149,6 +149,11 @@
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
+&gpu {
|
||||
+ mali-supply = <&vdd_gpu>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&hdmi {
|
||||
ddc-i2c-bus = <&i2c5>;
|
||||
status = "okay";
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From 89e5763110ca77d68a4be00cd97a638adc2401d5 Mon Sep 17 00:00:00 2001
|
||||
From: Willy Tarreau <w@1wt.eu>
|
||||
Date: Tue, 2 Aug 2016 08:31:00 +0200
|
||||
Subject: [PATCH 05/28] ARM: dts: rockchip: fix the regulator's voltage range
|
||||
on MiQi board
|
||||
|
||||
The board declared too narrow a voltage range for the CPU and GPU
|
||||
regulators, preventing it from using the full CPU frequency range.
|
||||
The regulators support 712500 to 1500000 microvolts.
|
||||
|
||||
Signed-off-by: Willy Tarreau <w@1wt.eu>
|
||||
(cherry picked from commit 95330e63a9295a2632cee8cce5db80677f01857a)
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-miqi.dts | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
index 3cd60674..a1c3cdaa 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
@@ -168,8 +168,8 @@
|
||||
fcs,suspend-voltage-selector = <1>;
|
||||
reg = <0x40>;
|
||||
regulator-name = "vdd_cpu";
|
||||
- regulator-min-microvolt = <850000>;
|
||||
- regulator-max-microvolt = <1350000>;
|
||||
+ regulator-min-microvolt = <712500>;
|
||||
+ regulator-max-microvolt = <1500000>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-enable-ramp-delay = <300>;
|
||||
@@ -182,8 +182,8 @@
|
||||
fcs,suspend-voltage-selector = <1>;
|
||||
reg = <0x41>;
|
||||
regulator-name = "vdd_gpu";
|
||||
- regulator-min-microvolt = <850000>;
|
||||
- regulator-max-microvolt = <1350000>;
|
||||
+ regulator-min-microvolt = <712500>;
|
||||
+ regulator-max-microvolt = <1500000>;
|
||||
regulator-always-on;
|
||||
vin-supply = <&vcc_sys>;
|
||||
};
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From c27e445527e949f3ef46d5326066196969c17d23 Mon Sep 17 00:00:00 2001
|
||||
From: Myy <myy@miouyouyou.fr>
|
||||
Date: Sun, 12 Mar 2017 19:43:15 +0000
|
||||
Subject: [PATCH 06/28] ARM: dts: rockchip: add the MiQi board's fan definition
|
||||
|
||||
The MiQi board is sold with an enclosure in which a fan is connected
|
||||
to the second LED output, and configured by default in "heartbeat"
|
||||
mode so that it rotates slowly and increases when the CPU load
|
||||
increases, ensuring appropriate cooling by default. This LED output
|
||||
is called "Fan" in the original kernel and connected to GPIO18
|
||||
(gpiochip 0, pin 18). Here we called it "miqi:green:fan" to stay
|
||||
consistent with the kernel's naming conventions.
|
||||
|
||||
It's worth noting that without this patch the fan doesn't work at
|
||||
all, risking to make the board overheat.
|
||||
|
||||
Fixes: 162718c (v4.7)
|
||||
Cc: Heiko Stuebner <heiko@sntech.de>
|
||||
Signed-off-by: Willy Tarreau <w@1wt.eu>
|
||||
|
||||
Signed-off-by: Myy <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-miqi.dts | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
index a1c3cdaa..0e383595 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
@@ -67,6 +67,13 @@
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
+ fan {
|
||||
+ gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
|
||||
+ label = "miqi:green:fan";
|
||||
+ linux,default-trigger = "heartbeat";
|
||||
+ };
|
||||
+
|
||||
+
|
||||
work_led: led-0 {
|
||||
gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
|
||||
label = "miqi:green:user";
|
||||
--
|
||||
2.11.0
|
||||
@@ -0,0 +1,31 @@
|
||||
From 062488e4b8fd552c01e1104b3bc91a6f7ffe6c41 Mon Sep 17 00:00:00 2001
|
||||
From: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
Date: Thu, 19 Oct 2017 21:24:47 +0200
|
||||
Subject: [PATCH 10/28] RK3288: DTSI: rk3288.dtsi: Add missing SPI2 pinctrl
|
||||
|
||||
The spi2_cs1 pin reference is missing in the spi2 first pin control
|
||||
definition.
|
||||
|
||||
This patch is taken from the patches provided by the ARMbian team.
|
||||
|
||||
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||
index 5b789528..9ed532cc 100644
|
||||
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||
@@ -334,7 +334,7 @@
|
||||
dma-names = "tx", "rx";
|
||||
interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
|
||||
pinctrl-names = "default";
|
||||
- pinctrl-0 = <&spi2_clk &spi2_tx &spi2_rx &spi2_cs0>;
|
||||
+ pinctrl-0 = <&spi2_clk &spi2_tx &spi2_rx &spi2_cs0 &spi2_cs1>;
|
||||
reg = <0x0 0xff130000 0x0 0x1000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From ac220d592aa38b9b717d36f7bb93f7be5a08f6b3 Mon Sep 17 00:00:00 2001
|
||||
From: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
Date: Thu, 19 Oct 2017 21:43:51 +0200
|
||||
Subject: [PATCH 14/28] ARM: DTSI: rk3288.dtsi: Adding missing EDP power domain
|
||||
|
||||
Imported from Rockchip 4.4 kernel patches.
|
||||
|
||||
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288.dtsi | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||
index 14ef8202..10ecebb4 100644
|
||||
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||
@@ -1105,6 +1105,7 @@
|
||||
interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&cru SCLK_EDP>, <&cru PCLK_EDP_CTRL>;
|
||||
clock-names = "dp", "pclk";
|
||||
+ power-domains = <&power RK3288_PD_VIO>;
|
||||
phys = <&edp_phy>;
|
||||
phy-names = "dp";
|
||||
resets = <&cru SRST_EDP>;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From a0602b2724893de7ac9b4190a7a6bb66458da2d5 Mon Sep 17 00:00:00 2001
|
||||
From: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
Date: Thu, 19 Oct 2017 21:54:37 +0200
|
||||
Subject: [PATCH 17/28] ARM: DTSI: rk3288.dtsi: Fixed the SPDIF node address
|
||||
|
||||
Now, the typo is only in the name of the node itself, not in the
|
||||
actual registers addresses definition.
|
||||
|
||||
Still, this ought to be fixed one day !
|
||||
|
||||
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||
index 125f8835..e5d3d3c9 100644
|
||||
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||
@@ -922,7 +922,7 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
- spdif: sound@ff88b0000 {
|
||||
+ spdif: sound@ff8b0000 {
|
||||
compatible = "rockchip,rk3288-spdif", "rockchip,rk3066-spdif";
|
||||
reg = <0x0 0xff8b0000 0x0 0x10000>;
|
||||
#sound-dai-cells = <0>;
|
||||
--
|
||||
2.11.0
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
From d5d5c53173c484a13cda62a537cbf75a5df4b0e4 Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Mon, 5 Nov 2018 21:58:56 +0100
|
||||
Subject: [PATCH] ARM: DTS: rk3288-tinker: Enabling SDIO and Wifi
|
||||
|
||||
Adding the appropriate nodes in order to exploit the WiFi capabilities
|
||||
of the board.
|
||||
Since these capabilities are provided through SDIO, and the SDIO
|
||||
nodes were not defined, these were added too.
|
||||
|
||||
These seems to depend on each other so they are added in one big
|
||||
patch.
|
||||
|
||||
Split if necessary.
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-tinker.dts | 62 +++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 62 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
index 1e43527aa..d4df13bed 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
@@ -6,8 +6,70 @@
|
||||
/dts-v1/;
|
||||
|
||||
#include "rk3288-tinker.dtsi"
|
||||
+#include <dt-bindings/clock/rockchip,rk808.h>
|
||||
|
||||
/ {
|
||||
model = "Rockchip RK3288 Asus Tinker Board";
|
||||
compatible = "asus,rk3288-tinker", "rockchip,rk3288";
|
||||
+
|
||||
+ /* This is essential to get SDIO devices working.
|
||||
+ The Wifi depends on SDIO ! */
|
||||
+ sdio_pwrseq: sdio-pwrseq {
|
||||
+ compatible = "mmc-pwrseq-simple";
|
||||
+ clocks = <&rk808 RK808_CLKOUT1>;
|
||||
+ clock-names = "ext_clock";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&chip_enable_h>, <&wifi_enable_h>;
|
||||
+
|
||||
+ /*
|
||||
+ * On the module itself this is one of these (depending
|
||||
+ * on the actual card populated):
|
||||
+ * - SDIO_RESET_L_WL_REG_ON
|
||||
+ * - PDN (power down when low)
|
||||
+ */
|
||||
+ reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>, <&gpio4 27 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wireless-wlan {
|
||||
+ compatible = "wlan-platdata";
|
||||
+ rockchip,grf = <&grf>;
|
||||
+ sdio_vref = <1800>;
|
||||
+ status = "okay";
|
||||
+ wifi_chip_type = "8723bs";
|
||||
+ WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&io_domains {
|
||||
+ wifi-supply = <&vcc_18>;
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ sdio-pwrseq {
|
||||
+ wifi_enable_h: wifienable-h {
|
||||
+ rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ chip_enable_h: chip-enable-h {
|
||||
+ rockchip,pins = <4 27 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&sdio0 {
|
||||
+ bus-width = <4>;
|
||||
+ cap-sd-highspeed;
|
||||
+ cap-sdio-irq;
|
||||
+ clock-frequency = <50000000>;
|
||||
+ clock-freq-min-max = <200000 50000000>;
|
||||
+ disable-wp;
|
||||
+ keep-power-in-suspend;
|
||||
+ mmc-pwrseq = <&sdio_pwrseq>;
|
||||
+ non-removable;
|
||||
+ num-slots = <1>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
|
||||
+ sd-uhs-sdr104;
|
||||
+ status = "okay";
|
||||
+ supports-sdio;
|
||||
};
|
||||
--
|
||||
2.16.4
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
From 2c2e60256f2cbb2fce50a6317f85b1500efd1a6c Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Mon, 5 Nov 2018 22:03:26 +0100
|
||||
Subject: [PATCH] ARM: DTS: rk3288-tinker: Setup the Bluetooth UART pins
|
||||
|
||||
The most essential being the RTS pin, which is clearly needed to
|
||||
upload the initial configuration into the Realtek Bluetooth
|
||||
chip, and make the Bluetooth chip work.
|
||||
|
||||
Now, the Bluetooth chip also needs 3 other GPIOS to be enabled.
|
||||
I'll see how I do that through the DTS file in a near future.
|
||||
|
||||
The 3 GPIOS being :
|
||||
Bluetooth Reset : <&gpio4 29 GPIO_ACTIVE_HIGH>
|
||||
Bluetooth Wake : <&gpio4 26 GPIO_ACTIVE_HIGH>
|
||||
Bluetooth Wake_Host_IRQ : <&gpio4 31 GPIO_ACTIVE_HIGH>
|
||||
|
||||
These are currently setup manually, through scripts. But it seems that
|
||||
GPIO handling through /sys entries might not be possible in the long
|
||||
term, the replacement being libgpio.
|
||||
Anyway, if you're interesting in enabling the Bluetooth GPIO by hand,
|
||||
here are the commands :
|
||||
|
||||
cd /sys/class/gpio &&
|
||||
echo 146 > export &&
|
||||
echo 149 > export &&
|
||||
echo 151 > export &&
|
||||
echo high > gpio146/direction &&
|
||||
echo high > gpio149/direction &&
|
||||
echo high > gpio151/direction
|
||||
|
||||
Resetting the chip is done like this :
|
||||
|
||||
echo "Resetting the Bluetooth chip"
|
||||
cd /sys/class/gpio/gpio149 &&
|
||||
echo 0 > value &&
|
||||
sleep 1 &&
|
||||
echo 1 > value &&
|
||||
sleep 1
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-tinker.dts | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
index d4df13bed..b92e59c1e 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
@@ -73,3 +73,9 @@
|
||||
status = "okay";
|
||||
supports-sdio;
|
||||
};
|
||||
+
|
||||
+&uart0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart0_xfer>, <&uart0_cts>, <&uart0_rts>;
|
||||
+};
|
||||
+
|
||||
--
|
||||
2.16.4
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From ebc29962ac27264772a4227f5abd6900cb72fa79 Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Mon, 5 Nov 2018 20:16:05 +0100
|
||||
Subject: [PATCH] ARM: DTSI: rk3288-tinker: Improving the CPU max voltage
|
||||
|
||||
Taken from the various patches provided by @TonyMac32 .
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-tinker.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
index aa107ee41..3da1c830f 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
@@ -164,7 +164,7 @@
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <750000>;
|
||||
- regulator-max-microvolt = <1400000>;
|
||||
+ regulator-max-microvolt = <1450000>;
|
||||
regulator-name = "vdd_arm";
|
||||
regulator-ramp-delay = <6000>;
|
||||
regulator-state-mem {
|
||||
--
|
||||
2.16.4
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
From a72e0749acad92df7b854e38e97e1dc7b4799abe Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Mon, 5 Nov 2018 22:11:24 +0100
|
||||
Subject: [PATCH] ARM: DTS: rk3288-tinker: Defined the I2C interfaces
|
||||
|
||||
And all the hardware behind.
|
||||
|
||||
Taken from @TonyMac32, Butchered by @Miouyouyou .
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-tinker.dts | 25 +++++++++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
index b92e59c1e..96d05fc6b 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
@@ -40,6 +40,31 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&i2c1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2c2 {
|
||||
+ afc0:af-controller@0 {
|
||||
+ status = "okay";
|
||||
+ compatible = "silicon touch,vm149C-v4l2-i2c-subdev";
|
||||
+ reg = <0x0 0x0c>;
|
||||
+ };
|
||||
+
|
||||
+ eeprom:m24c08@50 {
|
||||
+ compatible = "at,24c08";
|
||||
+ reg = <0x50>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2c3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2c4 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&io_domains {
|
||||
wifi-supply = <&vcc_18>;
|
||||
};
|
||||
--
|
||||
2.16.4
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
From b24b8f83e150811ad54ee2a4843e44cd1421fafa Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Mon, 5 Nov 2018 22:15:14 +0100
|
||||
Subject: [PATCH] ARM: DTS: rk3288-tinker: Defining the SPI interface
|
||||
|
||||
Taken from, and tested by @TonyMac32 .
|
||||
|
||||
Well, the original one was tested by him but I had to adapt the
|
||||
registers definitions to the new 64-bits LPAE-compliant syntax.
|
||||
|
||||
Therefore that *might* break, along with a few other patches.
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-tinker.dts | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-tinker.dts b/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
index 96d05fc6b..17bfea298 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-tinker.dts
|
||||
@@ -99,6 +99,25 @@
|
||||
supports-sdio;
|
||||
};
|
||||
|
||||
+&spi2 {
|
||||
+ max-freq = <50000000>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ spidev@0 {
|
||||
+ compatible = "rockchip,spi_tinker";
|
||||
+ reg = <0x0 0>;
|
||||
+ spi-max-frequency = <50000000>;
|
||||
+ spi-cpha = <1>;
|
||||
+ };
|
||||
+
|
||||
+ spidev@1 {
|
||||
+ compatible = "rockchip,spi_tinker";
|
||||
+ reg = <0x1>;
|
||||
+ spi-max-frequency = <50000000>;
|
||||
+ spi-cpha = <1>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&uart0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart0_xfer>, <&uart0_cts>, <&uart0_rts>;
|
||||
--
|
||||
2.16.4
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 487db7cefc9861fdaf30579c378a98f0360690ae Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Mon, 5 Nov 2018 20:27:14 +0100
|
||||
Subject: [PATCH] ARM: DTSI: rk3288-tinker: Defining SDMMC properties
|
||||
|
||||
I never knew if these properties were required to fix the dreaded
|
||||
reboot issue...
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-tinker.dtsi | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
index dd1090728..8edd6f681 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
@@ -436,7 +436,12 @@
|
||||
disable-wp; /* wp not hooked up */
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
|
||||
+ sd-uhs-sdr12;
|
||||
+ sd-uhs-sdr25;
|
||||
+ sd-uhs-sdr50;
|
||||
+ sd-uhs-sdr104;
|
||||
status = "okay";
|
||||
+ supports-sd;
|
||||
vmmc-supply = <&vcc33_sd>;
|
||||
vqmmc-supply = <&vccio_sd>;
|
||||
};
|
||||
--
|
||||
2.16.4
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From 4ab4f88649468dada5d609e1a6f8a71a7d5610c9 Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Sat, 29 Sep 2018 02:48:59 +0200
|
||||
Subject: [PATCH 4/6] dts: rk3288: support for dedicating npll to a vop
|
||||
|
||||
This patch is taken from Urja Rannikko ( @urjaman ) patchset here :
|
||||
https://github.com/urjaman/arch-c201/blob/master/linux-c201/0020-RK3288-HDMI-clock-hacks-combined.patch
|
||||
https://www.spinics.net/lists/arm-kernel/msg673156.html
|
||||
|
||||
The original description was :
|
||||
|
||||
Add the VOP DCLKs to the assigned clocks list so their
|
||||
parents can be set in the dts include files for
|
||||
devices that do dedicate npll to a vop.
|
||||
|
||||
https://www.spinics.net/lists/arm-kernel/msg673162.html
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288.dtsi | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||
index d23c7fa55..ff04aab5e 100644
|
||||
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||
@@ -867,12 +867,14 @@
|
||||
rockchip,grf = <&grf>;
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
- assigned-clocks = <&cru PLL_GPLL>, <&cru PLL_CPLL>,
|
||||
+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>,
|
||||
+ <&cru PLL_GPLL>, <&cru PLL_CPLL>,
|
||||
<&cru PLL_NPLL>, <&cru ACLK_CPU>,
|
||||
<&cru HCLK_CPU>, <&cru PCLK_CPU>,
|
||||
<&cru ACLK_PERI>, <&cru HCLK_PERI>,
|
||||
<&cru PCLK_PERI>;
|
||||
- assigned-clock-rates = <594000000>, <400000000>,
|
||||
+ assigned-clock-rates = <0>, <0>,
|
||||
+ <594000000>, <400000000>,
|
||||
<500000000>, <300000000>,
|
||||
<150000000>, <75000000>,
|
||||
<300000000>, <150000000>,
|
||||
--
|
||||
2.16.4
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 9177b30ab083dbda2bede3b3d61ef71ad4b1ffe0 Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Thu, 1 Nov 2018 21:31:26 +0100
|
||||
Subject: [PATCH 2/2] arm: dts: veyron: Added a flag to disable cache flush
|
||||
during reset
|
||||
|
||||
Flushing the MMC cache of ASUS Chromebooks during initialization or
|
||||
"recovery" generates 10 minutes hangup, according to @SolidHal.
|
||||
|
||||
This is an adaptation of @SolidHal, in order to pinpoint the fix to
|
||||
Veyron Chromebooks, and avoiding issues other RK3288 boards.
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-veyron.dtsi | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-veyron.dtsi b/arch/arm/boot/dts/rk3288-veyron.dtsi
|
||||
index 2075120cf..fa4951fd7 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-veyron.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288-veyron.dtsi
|
||||
@@ -123,6 +123,7 @@
|
||||
mmc-hs200-1_8v;
|
||||
mmc-pwrseq = <&emmc_pwrseq>;
|
||||
non-removable;
|
||||
+ no-recovery-cache-flush;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
|
||||
};
|
||||
--
|
||||
2.16.4
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||
index 0cd88774d..07681f1f0 100644
|
||||
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||
@@ -420,8 +420,6 @@
|
||||
reg-io-width = <4>;
|
||||
clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
|
||||
clock-names = "baudclk", "apb_pclk";
|
||||
- dmas = <&dmac_peri 1>, <&dmac_peri 2>;
|
||||
- dma-names = "tx", "rx";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart0_xfer>;
|
||||
status = "disabled";
|
||||
@@ -435,8 +433,6 @@
|
||||
reg-io-width = <4>;
|
||||
clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>;
|
||||
clock-names = "baudclk", "apb_pclk";
|
||||
- dmas = <&dmac_peri 3>, <&dmac_peri 4>;
|
||||
- dma-names = "tx", "rx";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart1_xfer>;
|
||||
status = "disabled";
|
||||
@@ -463,8 +459,6 @@
|
||||
reg-io-width = <4>;
|
||||
clocks = <&cru SCLK_UART3>, <&cru PCLK_UART3>;
|
||||
clock-names = "baudclk", "apb_pclk";
|
||||
- dmas = <&dmac_peri 7>, <&dmac_peri 8>;
|
||||
- dma-names = "tx", "rx";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart3_xfer>;
|
||||
status = "disabled";
|
||||
@@ -478,8 +472,6 @@
|
||||
reg-io-width = <4>;
|
||||
clocks = <&cru SCLK_UART4>, <&cru PCLK_UART4>;
|
||||
clock-names = "baudclk", "apb_pclk";
|
||||
- dmas = <&dmac_peri 9>, <&dmac_peri 10>;
|
||||
- dma-names = "tx", "rx";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart4_xfer>;
|
||||
status = "disabled";
|
||||
@@ -0,0 +1,42 @@
|
||||
From 73258d32daf3a661281bb5c77c5e2e06c7ff714e Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Fri, 3 Jul 2020 02:02:18 +0200
|
||||
Subject: [PATCH] arm: dtsi: rk3288: add GPU 500 Mhz OPP again
|
||||
|
||||
Undoing the very bizarre mainline kernel patch,
|
||||
75481833c6dbab4c29d15452f6b4337c16f5407b
|
||||
which main purpose is to sync some 3.14 kernels hacks to
|
||||
mainline kernels, for reasons that only matter for a few Chromebooks,
|
||||
and shove it down the throat of every RK3288 user.
|
||||
|
||||
If you need to avoid the GPU going to 500 Mhz on Chromebooks,
|
||||
remove the OPP entry inside the DTS that actually matters to RK3288
|
||||
Chromebooks.
|
||||
|
||||
Meanwhile, the 600 Mhz operating point can prove to be unstable on
|
||||
some RK3288 boards, while 500 Mhz works fine.
|
||||
https://forum.armbian.com/topic/13515-panfrost-on-rk3288-and-gpu-on-600mhz-problems/
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
arch/arm/boot/dts/rk3288.dtsi | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||
index a66412547..ef7457f79 100644
|
||||
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||
@@ -1312,6 +1312,10 @@ opp-400000000 {
|
||||
opp-hz = /bits/ 64 <400000000>;
|
||||
opp-microvolt = <1100000>;
|
||||
};
|
||||
+ opp-500000000 {
|
||||
+ opp-hz = /bits/ 64 <500000000>;
|
||||
+ opp-microvolt = <1200000>;
|
||||
+ };
|
||||
opp-600000000 {
|
||||
opp-hz = /bits/ 64 <600000000>;
|
||||
opp-microvolt = <1250000>;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
13
patch/kernel/archive/rockchip-5.17/1027-fix-rga-probe.patch
Normal file
13
patch/kernel/archive/rockchip-5.17/1027-fix-rga-probe.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
|
||||
index 6759091b1..d99ea8973 100644
|
||||
--- a/drivers/media/platform/rockchip/rga/rga.c
|
||||
+++ b/drivers/media/platform/rockchip/rga/rga.c
|
||||
@@ -895,7 +895,7 @@ static int rga_probe(struct platform_device *pdev)
|
||||
}
|
||||
rga->dst_mmu_pages =
|
||||
(unsigned int *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 3);
|
||||
- if (rga->dst_mmu_pages) {
|
||||
+ if (!rga->dst_mmu_pages) {
|
||||
ret = -ENOMEM;
|
||||
goto free_src_pages;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
From 0bcc81848ec1fb34fee9d3c7eb1550495cc8efc9 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sat, 18 Sep 2021 12:31:19 +0000
|
||||
Subject: [PATCH 1/2] rockchip: enable hevc, hevc_mmu and rga nodes for
|
||||
tinkerboard (both)
|
||||
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-tinker.dtsi | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
index aa36aedf9..ff2c6de32 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
@@ -150,6 +150,14 @@ &hdmi {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&hevc {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hevc_mmu {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&i2c0 {
|
||||
clock-frequency = <400000>;
|
||||
status = "okay";
|
||||
@@ -449,6 +457,10 @@ &pwm0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&rga {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&saradc {
|
||||
vref-supply = <&vcc18_ldo1>;
|
||||
status = "okay";
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From 2fdd826a704ef70df42d92b38ad88ef869c3729b Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sat, 18 Sep 2021 12:32:05 +0000
|
||||
Subject: [PATCH 2/2] rockchip: enable hevc, hevc_mmu and rga nodes for miqi
|
||||
|
||||
---
|
||||
arch/arm/boot/dts/rk3288-miqi.dts | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/rk3288-miqi.dts b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
index 94bc76099..68eb766f0 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
+++ b/arch/arm/boot/dts/rk3288-miqi.dts
|
||||
@@ -162,6 +162,14 @@ &hdmi {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&hevc {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hevc_mmu {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&i2c0 {
|
||||
clock-frequency = <400000>;
|
||||
status = "okay";
|
||||
@@ -405,6 +413,10 @@ host_vbus_drv: host-vbus-drv {
|
||||
};
|
||||
};
|
||||
|
||||
+&rga {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&saradc {
|
||||
vref-supply = <&vcc_18>;
|
||||
status = "okay";
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
From e0c5a419cf5464cd02996431afa98e3b22dc6801 Mon Sep 17 00:00:00 2001
|
||||
From: Myy <myy@miouyouyou.fr>
|
||||
Date: Mon, 17 Jul 2017 23:14:48 +0000
|
||||
Subject: [PATCH] clk: rockchip: add all known operating points to the allowed
|
||||
CPU freqs
|
||||
|
||||
Patch from Willy Tarreau
|
||||
|
||||
Original commit message :
|
||||
At least 1920 MHz runs stable on the MiQi even on openssl speed -multi 4,
|
||||
which is by far the most intensive workload, and 1992/2016 work fine on
|
||||
the CS-008 until it starts to heat too much. So add all of them so that
|
||||
the device tree can simply manipulate them.
|
||||
|
||||
Signed-off-by: Myy <myy@miouyouyou.fr>
|
||||
---
|
||||
drivers/clk/rockchip/clk-rk3288.c | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c
|
||||
index 753c649..fd2058f 100644
|
||||
--- a/drivers/clk/rockchip/clk-rk3288.c
|
||||
+++ b/drivers/clk/rockchip/clk-rk3288.c
|
||||
@@ -145,6 +145,23 @@ static struct rockchip_pll_rate_table rk3288_pll_rates[] = {
|
||||
}
|
||||
|
||||
static struct rockchip_cpuclk_rate_table rk3288_cpuclk_rates[] __initdata = {
|
||||
+ RK3288_CPUCLK_RATE(2208000000U, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(2184000000U, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(2160000000U, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(2136000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(2112000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(2088000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(2064000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(2040000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(2016000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(1992000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(1968000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(1944000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(1920000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(1896000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(1872000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(1848000000, 1, 3, 1, 3, 3),
|
||||
+ RK3288_CPUCLK_RATE(1824000000, 1, 3, 1, 3, 3),
|
||||
RK3288_CPUCLK_RATE(1800000000, 1, 3, 1, 3, 3),
|
||||
RK3288_CPUCLK_RATE(1704000000, 1, 3, 1, 3, 3),
|
||||
RK3288_CPUCLK_RATE(1608000000, 1, 3, 1, 3, 3),
|
||||
--
|
||||
2.10.2
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
From 302cd9b8a9f1f8a7735fabea3b9a7645dc40f9cc Mon Sep 17 00:00:00 2001
|
||||
From: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
Date: Sun, 7 Jan 2018 01:52:44 +0100
|
||||
Subject: [PATCH] drivers: mmc: dw-mci-rockchip: Handle ASUS Tinkerboard reboot
|
||||
|
||||
On ASUS Tinkerboard systems, if the SDMMC hardware is shutdown before
|
||||
rebooting, the system will be dead, as the SDMMC is the only way to
|
||||
boot anything, and the hardware doesn't power up the SDMMC hardware
|
||||
automatically when rebooting.
|
||||
|
||||
So, when using an ASUS Tinkerboard system, a new reboot handler is
|
||||
installed. This reboot handler takes care of powering the SDMMC
|
||||
hardware again before restarting the system, resolving the issue.
|
||||
|
||||
The code was inspired by the pwrseq_emmc.c, which seems to overcome
|
||||
similar effects with eMMC hardware.
|
||||
|
||||
Signed-off-by: Myy Miouyouyou <myy@miouyouyou.fr>
|
||||
---
|
||||
drivers/mmc/host/dw_mmc-rockchip.c | 66 ++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 66 insertions(+)
|
||||
|
||||
diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
|
||||
index a3f1c2b30..7eac1f221 100644
|
||||
--- a/drivers/mmc/host/dw_mmc-rockchip.c
|
||||
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
|
||||
@@ -16,6 +16,11 @@
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
+#include <linux/regulator/consumer.h>
|
||||
+#include <linux/reboot.h>
|
||||
+#include <linux/delay.h>
|
||||
+#include "../core/core.h"
|
||||
+
|
||||
#include "dw_mmc.h"
|
||||
#include "dw_mmc-pltfm.h"
|
||||
|
||||
@@ -334,6 +339,66 @@ static const struct of_device_id dw_mci_rockchip_match[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, dw_mci_rockchip_match);
|
||||
|
||||
+struct dw_mci_rockchip_broken_boards_data {
|
||||
+ struct notifier_block reset_nb;
|
||||
+ struct platform_device *pdev;
|
||||
+};
|
||||
+
|
||||
+/* This reboot handler handles cases where disabling the SDMMC on
|
||||
+ * reboot will cause the hardware to be unable to start correctly
|
||||
+ * after rebooting.
|
||||
+ *
|
||||
+ * This happens with Tinkerboard systems...
|
||||
+ */
|
||||
+static int dw_mci_rockchip_broken_boards_reset_nb(
|
||||
+ struct notifier_block *this,
|
||||
+ unsigned long mode, void *cmd)
|
||||
+{
|
||||
+ struct dw_mci_rockchip_broken_boards_data const *data =
|
||||
+ container_of(this,
|
||||
+ struct dw_mci_rockchip_broken_boards_data,
|
||||
+ reset_nb);
|
||||
+ struct dw_mci *host = platform_get_drvdata(data->pdev);
|
||||
+ struct mmc_host *mmc = host->slot->mmc;
|
||||
+
|
||||
+ printk(KERN_ERR "Meow.\n");
|
||||
+
|
||||
+ mmc_power_off(mmc);
|
||||
+
|
||||
+ mdelay(20);
|
||||
+
|
||||
+ if (!IS_ERR(mmc->supply.vmmc))
|
||||
+ regulator_enable(mmc->supply.vmmc);
|
||||
+
|
||||
+ if (!IS_ERR(mmc->supply.vqmmc))
|
||||
+ regulator_set_voltage(mmc->supply.vqmmc, 3000000, 3300000);
|
||||
+
|
||||
+ printk(KERN_ERR "woeM.\n");
|
||||
+
|
||||
+ return NOTIFY_DONE;
|
||||
+}
|
||||
+
|
||||
+static void dw_mci_rockchip_register_broken_boards_reboot_handler(
|
||||
+ struct platform_device *pdev)
|
||||
+{
|
||||
+ struct dw_mci_rockchip_broken_boards_data *data;
|
||||
+
|
||||
+ if (!of_machine_is_compatible("asus,rk3288-tinker"))
|
||||
+ return;
|
||||
+
|
||||
+ data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
|
||||
+
|
||||
+ if (!data)
|
||||
+ return;
|
||||
+
|
||||
+ data->reset_nb.notifier_call =
|
||||
+ dw_mci_rockchip_broken_boards_reset_nb;
|
||||
+ data->reset_nb.priority = 255;
|
||||
+ register_restart_handler(&data->reset_nb);
|
||||
+
|
||||
+ data->pdev = pdev;
|
||||
+}
|
||||
+
|
||||
static int dw_mci_rockchip_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct dw_mci_drv_data *drv_data;
|
||||
@@ -361,6 +426,7 @@ static int dw_mci_rockchip_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
pm_runtime_put_autosuspend(&pdev->dev);
|
||||
+ dw_mci_rockchip_register_broken_boards_reboot_handler(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.14.1
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
FROM: Solidhal <hal@halemmerich.com>
|
||||
|
||||
This patch reverses commit 2b721118b7821107757eb1d37af4b60e877b27e7, as can bee seen here:
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2b721118b7821107757eb1d37af4b60e877b27e7
|
||||
|
||||
This commit caused issues on veyron speedy with ath9k and dwc2 drivers. Any ath9k device (ar9271)
|
||||
would intermittently work, most of the time ending in errors as can bee seen here:
|
||||
https://github.com/SolidHal/PrawnOS/issues/38
|
||||
This commit fixes that issue.
|
||||
This is only a temporary work around while a permenant fix is found, as this commit seems to only cause issues
|
||||
with dwc2
|
||||
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
|
||||
index 3f563e02d..903851481 100644
|
||||
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
|
||||
@@ -118,10 +118,10 @@ static int hif_usb_send_regout(struct hif_device_usb *hif_dev,
|
||||
cmd->skb = skb;
|
||||
cmd->hif_dev = hif_dev;
|
||||
|
||||
- usb_fill_int_urb(urb, hif_dev->udev,
|
||||
- usb_sndintpipe(hif_dev->udev, USB_REG_OUT_PIPE),
|
||||
+ usb_fill_bulk_urb(urb, hif_dev->udev,
|
||||
+ usb_sndbulkpipe(hif_dev->udev, USB_REG_OUT_PIPE),
|
||||
skb->data, skb->len,
|
||||
- hif_usb_regout_cb, cmd, 1);
|
||||
+ hif_usb_regout_cb, cmd);
|
||||
|
||||
usb_anchor_urb(urb, &hif_dev->regout_submitted);
|
||||
ret = usb_submit_urb(urb, GFP_KERNEL);
|
||||
@@ -735,11 +735,11 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
|
||||
|
||||
rx_buf->skb = nskb;
|
||||
|
||||
- usb_fill_int_urb(urb, hif_dev->udev,
|
||||
- usb_rcvintpipe(hif_dev->udev,
|
||||
+ usb_fill_bulk_urb(urb, hif_dev->udev,
|
||||
+ usb_rcvbulkpipe(hif_dev->udev,
|
||||
USB_REG_IN_PIPE),
|
||||
nskb->data, MAX_REG_IN_BUF_SIZE,
|
||||
- ath9k_hif_usb_reg_in_cb, rx_buf, 1);
|
||||
+ ath9k_hif_usb_reg_in_cb, rx_buf);
|
||||
}
|
||||
|
||||
resubmit:
|
||||
@@ -944,11 +944,11 @@ static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev)
|
||||
rx_buf->hif_dev = hif_dev;
|
||||
rx_buf->skb = skb;
|
||||
|
||||
- usb_fill_int_urb(urb, hif_dev->udev,
|
||||
- usb_rcvintpipe(hif_dev->udev,
|
||||
+ usb_fill_bulk_urb(urb, hif_dev->udev,
|
||||
+ usb_rcvbulkpipe(hif_dev->udev,
|
||||
USB_REG_IN_PIPE),
|
||||
skb->data, MAX_REG_IN_BUF_SIZE,
|
||||
- ath9k_hif_usb_reg_in_cb, rx_buf, 1);
|
||||
+ ath9k_hif_usb_reg_in_cb, skb);
|
||||
|
||||
/* Anchor URB */
|
||||
usb_anchor_urb(urb, &hif_dev->reg_in_submitted);
|
||||
@@ -1069,7 +1069,9 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
|
||||
|
||||
static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev)
|
||||
{
|
||||
- int ret;
|
||||
+ struct usb_host_interface *alt = &hif_dev->interface->altsetting[0];
|
||||
+ struct usb_endpoint_descriptor *endp;
|
||||
+ int ret, idx;
|
||||
|
||||
ret = ath9k_hif_usb_download_fw(hif_dev);
|
||||
if (ret) {
|
||||
@@ -1079,6 +1081,20 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ /* On downloading the firmware to the target, the USB descriptor of EP4
|
||||
+ * is 'patched' to change the type of the endpoint to Bulk. This will
|
||||
+ * bring down CPU usage during the scan period.
|
||||
+ */
|
||||
+ for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) {
|
||||
+ endp = &alt->endpoint[idx].desc;
|
||||
+ if ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
|
||||
+ == USB_ENDPOINT_XFER_INT) {
|
||||
+ endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK;
|
||||
+ endp->bmAttributes |= USB_ENDPOINT_XFER_BULK;
|
||||
+ endp->bInterval = 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Alloc URBs */
|
||||
ret = ath9k_hif_usb_alloc_urbs(hif_dev);
|
||||
if (ret) {
|
||||
@@ -1353,7 +1369,7 @@ static void ath9k_hif_usb_reboot(struct usb_device *udev)
|
||||
if (!buf)
|
||||
return;
|
||||
|
||||
- ret = usb_interrupt_msg(udev, usb_sndintpipe(udev, USB_REG_OUT_PIPE),
|
||||
+ ret = usb_bulk_msg(udev, usb_sndbulkpipe(udev, USB_REG_OUT_PIPE),
|
||||
buf, 4, NULL, USB_MSG_TIMEOUT);
|
||||
if (ret)
|
||||
dev_err(&udev->dev, "ath9k_htc: USB reboot failed\n");
|
||||
@@ -0,0 +1,22 @@
|
||||
From d4d128324b8f8a9f5c441203d94703e41fa07df3 Mon Sep 17 00:00:00 2001
|
||||
From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
|
||||
Date: Mon, 5 Nov 2018 19:57:56 +0100
|
||||
Subject: [PATCH] spi: Added support for Tinkerboard's SPI interface
|
||||
|
||||
Imported from ARMbian
|
||||
|
||||
Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
|
||||
---
|
||||
|
||||
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
|
||||
index 255786f2e..3a3f2e6fd 100644
|
||||
--- a/drivers/spi/spidev.c
|
||||
+++ b/drivers/spi/spidev.c
|
||||
@@ -684,6 +684,7 @@ static const struct of_device_id spidev_dt_ids[] = {
|
||||
{ .compatible = "menlo,m53cpld" },
|
||||
{ .compatible = "cisco,spi-petra" },
|
||||
{ .compatible = "micron,spi-authenta" },
|
||||
+ { .compatible = "rockchip,spi_tinker" },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, spidev_dt_ids);
|
||||
395
patch/kernel/archive/rockchip-5.17/261_gpiomem_driver.patch
Normal file
395
patch/kernel/archive/rockchip-5.17/261_gpiomem_driver.patch
Normal file
@@ -0,0 +1,395 @@
|
||||
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
index e5b7ef1a5..f88c913ff 100644
|
||||
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
|
||||
@@ -544,3 +544,6 @@
|
||||
&wdt {
|
||||
status = "okay";
|
||||
};
|
||||
+&gpiomem {
|
||||
+ status = "okay";
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||
index f3ca55496..14bbcb192 100644
|
||||
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||
@@ -1418,6 +1418,12 @@
|
||||
interrupts = <GIC_PPI 9 0xf04>;
|
||||
};
|
||||
|
||||
+ gpiomem: rk3288-gpiomem@ff750000 {
|
||||
+ compatible = "rockchip,rk3288-gpiomem";
|
||||
+ reg = <0x0 0xff750000 0x0 0x1000>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
pinctrl: pinctrl {
|
||||
compatible = "rockchip,rk3288-pinctrl";
|
||||
rockchip,grf = <&grf>;
|
||||
|
||||
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
|
||||
index 3143db5..9c18b74 100644
|
||||
--- a/drivers/char/Kconfig
|
||||
+++ b/drivers/char/Kconfig
|
||||
@@ -5,6 +5,7 @@
|
||||
menu "Character devices"
|
||||
|
||||
source "drivers/tty/Kconfig"
|
||||
+source "drivers/char/rockchip/Kconfig"
|
||||
|
||||
config DEVMEM
|
||||
bool "/dev/mem virtual device support"
|
||||
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
|
||||
index 264eb398f..9fd5f240b 100644
|
||||
--- a/drivers/char/Makefile
|
||||
+++ b/drivers/char/Makefile
|
||||
@@ -43,6 +43,8 @@ obj-$(CONFIG_TCG_TPM) += tpm/
|
||||
|
||||
obj-$(CONFIG_PS3_FLASH) += ps3flash.o
|
||||
|
||||
+obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
|
||||
+
|
||||
obj-$(CONFIG_XILLYBUS_CLASS) += xillybus/
|
||||
obj-$(CONFIG_POWERNV_OP_PANEL) += powernv-op-panel.o
|
||||
obj-$(CONFIG_ADI) += adi.o
|
||||
diff --git a/drivers/char/rockchip/Kconfig b/drivers/char/rockchip/Kconfig
|
||||
new file mode 100644
|
||||
index 0000000..6e97486
|
||||
--- /dev/null
|
||||
+++ b/drivers/char/rockchip/Kconfig
|
||||
@@ -0,0 +1,16 @@
|
||||
+#
|
||||
+# Broadcom char driver config
|
||||
+#
|
||||
+
|
||||
+menuconfig RK_CHAR_DRIVERS
|
||||
+ bool "Rockchip Char Drivers"
|
||||
+ help
|
||||
+ Rockchip's char drivers
|
||||
+
|
||||
+config RK3288_DEVGPIOMEM
|
||||
+ tristate "/dev/gpiomem rootless GPIO access via mmap() on the RK3288"
|
||||
+ default y
|
||||
+ help
|
||||
+ Provides users with root-free access to the GPIO registers
|
||||
+ on the 3288. Calling mmap(/dev/gpiomem) will map the GPIO
|
||||
+ register page to the user's pointer.
|
||||
\ No newline at end of file
|
||||
diff --git a/drivers/char/rockchip/Makefile b/drivers/char/rockchip/Makefile
|
||||
new file mode 100644
|
||||
index 0000000..2287ec2
|
||||
--- /dev/null
|
||||
+++ b/drivers/char/rockchip/Makefile
|
||||
@@ -0,0 +1 @@
|
||||
+obj-$(CONFIG_RK3288_DEVGPIOMEM)+= rk3288-gpiomem.o
|
||||
\ No newline at end of file
|
||||
diff --git a/drivers/char/rockchip/rk3288-gpiomem.c b/drivers/char/rockchip/rk3288-gpiomem.c
|
||||
new file mode 100644
|
||||
index 0000000..984471c
|
||||
--- /dev/null
|
||||
+++ b/drivers/char/rockchip/rk3288-gpiomem.c
|
||||
@@ -0,0 +1,303 @@
|
||||
+/**
|
||||
+ * GPIO memory device driver
|
||||
+ *
|
||||
+ * Creates a chardev /dev/gpiomem which will provide user access to
|
||||
+ * the rk3288's GPIO registers when it is mmap()'d.
|
||||
+ * No longer need root for user GPIO access, but without relaxing permissions
|
||||
+ * on /dev/mem.
|
||||
+ *
|
||||
+ * Written by Luke Wren <luke@raspberrypi.org>
|
||||
+ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd.
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ * 1. Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions, and the following disclaimer,
|
||||
+ * without modification.
|
||||
+ * 2. Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ * 3. The names of the above-listed copyright holders may not be used
|
||||
+ * to endorse or promote products derived from this software without
|
||||
+ * specific prior written permission.
|
||||
+ *
|
||||
+ * ALTERNATIVELY, this software may be distributed under the terms of the
|
||||
+ * GNU General Public License ("GPL") version 2, as published by the Free
|
||||
+ * Software Foundation.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/mm.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/cdev.h>
|
||||
+#include <linux/pagemap.h>
|
||||
+#include <linux/io.h>
|
||||
+
|
||||
+#define DEVICE_NAME "rk3288-gpiomem"
|
||||
+#define DRIVER_NAME "gpiomem-rk3288"
|
||||
+#define DEVICE_MINOR 0
|
||||
+
|
||||
+struct rk3288_gpiomem_instance {
|
||||
+ unsigned long gpio_regs_phys;
|
||||
+ struct device *dev;
|
||||
+};
|
||||
+
|
||||
+static struct cdev rk3288_gpiomem_cdev;
|
||||
+static dev_t rk3288_gpiomem_devid;
|
||||
+static struct class *rk3288_gpiomem_class;
|
||||
+static struct device *rk3288_gpiomem_dev;
|
||||
+static struct rk3288_gpiomem_instance *inst;
|
||||
+
|
||||
+
|
||||
+/****************************************************************************
|
||||
+*
|
||||
+* GPIO mem chardev file ops
|
||||
+*
|
||||
+***************************************************************************/
|
||||
+
|
||||
+static int rk3288_gpiomem_open(struct inode *inode, struct file *file)
|
||||
+{
|
||||
+ int dev = iminor(inode);
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (dev != DEVICE_MINOR) {
|
||||
+ dev_err(inst->dev, "Unknown minor device: %d", dev);
|
||||
+ ret = -ENXIO;
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int rk3288_gpiomem_release(struct inode *inode, struct file *file)
|
||||
+{
|
||||
+ int dev = iminor(inode);
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (dev != DEVICE_MINOR) {
|
||||
+ dev_err(inst->dev, "Unknown minor device %d", dev);
|
||||
+ ret = -ENXIO;
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static const struct vm_operations_struct rk3288_gpiomem_vm_ops = {
|
||||
+#ifdef CONFIG_HAVE_IOREMAP_PROT
|
||||
+ .access = generic_access_phys
|
||||
+#endif
|
||||
+};
|
||||
+static int address_is_allowed(unsigned long pfn, unsigned long size)
|
||||
+{
|
||||
+ unsigned long address = pfn << PAGE_SHIFT;
|
||||
+
|
||||
+ dev_info(inst->dev, "address_is_allowed.pfn: 0x%08lx", address);
|
||||
+
|
||||
+ switch(address) {
|
||||
+
|
||||
+ case 0xff750000:
|
||||
+ case 0xff760000:
|
||||
+ case 0xff780000:
|
||||
+ case 0xff790000:
|
||||
+ case 0xff7a0000:
|
||||
+ case 0xff7b0000:
|
||||
+ case 0xff7c0000:
|
||||
+ case 0xff7d0000:
|
||||
+ case 0xff7e0000:
|
||||
+ case 0xff7f0000:
|
||||
+ case 0xff7f2000:
|
||||
+ case 0xff770000:
|
||||
+ case 0xff730000:
|
||||
+ case 0xff680000:
|
||||
+ dev_info(inst->dev, "address_is_allowed.return 1");
|
||||
+ return 1;
|
||||
+ break;
|
||||
+ default :
|
||||
+ dev_info(inst->dev, "address_is_allowed.return 0");
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int rk3288_gpiomem_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
+{
|
||||
+
|
||||
+ size_t size;
|
||||
+
|
||||
+ size = vma->vm_end - vma->vm_start;
|
||||
+
|
||||
+
|
||||
+ if (!address_is_allowed(vma->vm_pgoff, size))
|
||||
+ return -EPERM;
|
||||
+
|
||||
+ vma->vm_page_prot = phys_mem_access_prot(file, vma->vm_pgoff,
|
||||
+ size,
|
||||
+ vma->vm_page_prot);
|
||||
+
|
||||
+ vma->vm_ops = &rk3288_gpiomem_vm_ops;
|
||||
+
|
||||
+ /* Remap-pfn-range will mark the range VM_IO */
|
||||
+ if (remap_pfn_range(vma,
|
||||
+ vma->vm_start,
|
||||
+ vma->vm_pgoff,
|
||||
+ size,
|
||||
+ vma->vm_page_prot)) {
|
||||
+ return -EAGAIN;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations
|
||||
+rk3288_gpiomem_fops = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .open = rk3288_gpiomem_open,
|
||||
+ .release = rk3288_gpiomem_release,
|
||||
+ .mmap = rk3288_gpiomem_mmap,
|
||||
+};
|
||||
+
|
||||
+static int rk3288_gpiomem_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
|
||||
+{
|
||||
+ add_uevent_var(env, "DEVMODE=%#o", 0666);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+ /****************************************************************************
|
||||
+*
|
||||
+* Probe and remove functions
|
||||
+*
|
||||
+***************************************************************************/
|
||||
+
|
||||
+
|
||||
+static int rk3288_gpiomem_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ int err;
|
||||
+ void *ptr_err;
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct resource *ioresource;
|
||||
+
|
||||
+ /* Allocate buffers and instance data */
|
||||
+
|
||||
+ inst = kzalloc(sizeof(struct rk3288_gpiomem_instance), GFP_KERNEL);
|
||||
+
|
||||
+ if (!inst) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto failed_inst_alloc;
|
||||
+ }
|
||||
+
|
||||
+ inst->dev = dev;
|
||||
+
|
||||
+ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
+ if (ioresource) {
|
||||
+ inst->gpio_regs_phys = ioresource->start;
|
||||
+ } else {
|
||||
+ dev_err(inst->dev, "failed to get IO resource");
|
||||
+ err = -ENOENT;
|
||||
+ goto failed_get_resource;
|
||||
+ }
|
||||
+
|
||||
+ /* Create character device entries */
|
||||
+
|
||||
+ err = alloc_chrdev_region(&rk3288_gpiomem_devid,
|
||||
+ DEVICE_MINOR, 1, DEVICE_NAME);
|
||||
+ if (err != 0) {
|
||||
+ dev_err(inst->dev, "unable to allocate device number");
|
||||
+ goto failed_alloc_chrdev;
|
||||
+ }
|
||||
+ cdev_init(&rk3288_gpiomem_cdev, &rk3288_gpiomem_fops);
|
||||
+ rk3288_gpiomem_cdev.owner = THIS_MODULE;
|
||||
+ err = cdev_add(&rk3288_gpiomem_cdev, rk3288_gpiomem_devid, 1);
|
||||
+ if (err != 0) {
|
||||
+ dev_err(inst->dev, "unable to register device");
|
||||
+ goto failed_cdev_add;
|
||||
+ }
|
||||
+
|
||||
+ /* Create sysfs entries */
|
||||
+
|
||||
+ rk3288_gpiomem_class = class_create(THIS_MODULE, DEVICE_NAME);
|
||||
+ ptr_err = rk3288_gpiomem_class;
|
||||
+ if (IS_ERR(ptr_err))
|
||||
+ goto failed_class_create;
|
||||
+ rk3288_gpiomem_class->dev_uevent = rk3288_gpiomem_dev_uevent;
|
||||
+ rk3288_gpiomem_dev = device_create(rk3288_gpiomem_class, NULL,
|
||||
+ rk3288_gpiomem_devid, NULL,
|
||||
+ "gpiomem");
|
||||
+ ptr_err = rk3288_gpiomem_dev;
|
||||
+ if (IS_ERR(ptr_err))
|
||||
+ goto failed_device_create;
|
||||
+
|
||||
+ dev_info(inst->dev, "Initialised: Registers at 0x%08lx",
|
||||
+ inst->gpio_regs_phys);
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+failed_device_create:
|
||||
+ class_destroy(rk3288_gpiomem_class);
|
||||
+failed_class_create:
|
||||
+ cdev_del(&rk3288_gpiomem_cdev);
|
||||
+ err = PTR_ERR(ptr_err);
|
||||
+failed_cdev_add:
|
||||
+ unregister_chrdev_region(rk3288_gpiomem_devid, 1);
|
||||
+failed_alloc_chrdev:
|
||||
+failed_get_resource:
|
||||
+ kfree(inst);
|
||||
+failed_inst_alloc:
|
||||
+ dev_err(inst->dev, "could not load rk3288_gpiomem");
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int rk3288_gpiomem_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = inst->dev;
|
||||
+
|
||||
+ kfree(inst);
|
||||
+ device_destroy(rk3288_gpiomem_class, rk3288_gpiomem_devid);
|
||||
+ class_destroy(rk3288_gpiomem_class);
|
||||
+ cdev_del(&rk3288_gpiomem_cdev);
|
||||
+ unregister_chrdev_region(rk3288_gpiomem_devid, 1);
|
||||
+
|
||||
+ dev_info(dev, "GPIO mem driver removed - OK");
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+ /****************************************************************************
|
||||
+*
|
||||
+* Register the driver with device tree
|
||||
+*
|
||||
+***************************************************************************/
|
||||
+
|
||||
+static const struct of_device_id rk3288_gpiomem_of_match[] = {
|
||||
+ {.compatible = "rockchip,rk3288-gpiomem",},
|
||||
+ { /* sentinel */ },
|
||||
+};
|
||||
+
|
||||
+MODULE_DEVICE_TABLE(of, rk3288_gpiomem_of_match);
|
||||
+
|
||||
+static struct platform_driver rk3288_gpiomem_driver = {
|
||||
+ .probe = rk3288_gpiomem_probe,
|
||||
+ .remove = rk3288_gpiomem_remove,
|
||||
+ .driver = {
|
||||
+ .name = DRIVER_NAME,
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .of_match_table = rk3288_gpiomem_of_match,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+module_platform_driver(rk3288_gpiomem_driver);
|
||||
+
|
||||
+MODULE_ALIAS("platform:gpiomem-rk3288");
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace");
|
||||
+MODULE_AUTHOR("Luke Wren <luke@raspberrypi.org>");
|
||||
\ No newline at end of file
|
||||
@@ -0,0 +1,32 @@
|
||||
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||
index bc3601a..37ae378 100644
|
||||
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||
@@ -467,13 +467,6 @@
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
- reserve_thermal: reserve-thermal {
|
||||
- polling-delay-passive = <1000>; /* milliseconds */
|
||||
- polling-delay = <5000>; /* milliseconds */
|
||||
-
|
||||
- thermal-sensors = <&tsadc 0>;
|
||||
- };
|
||||
-
|
||||
cpu_thermal: cpu-thermal {
|
||||
polling-delay-passive = <100>; /* milliseconds */
|
||||
polling-delay = <5000>; /* milliseconds */
|
||||
@@ -539,6 +532,13 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
+
|
||||
+ reserve_thermal: reserve-thermal {
|
||||
+ polling-delay-passive = <1000>; /* milliseconds */
|
||||
+ polling-delay = <5000>; /* milliseconds */
|
||||
+
|
||||
+ thermal-sensors = <&tsadc 0>;
|
||||
+ };
|
||||
};
|
||||
|
||||
tsadc: tsadc@ff280000 {
|
||||
@@ -0,0 +1,19 @@
|
||||
diff --git a/sound/usb/card.c b/sound/usb/card.c
|
||||
index 2bfe4e80a..cea93aaf5 100644
|
||||
--- a/sound/usb/card.c
|
||||
+++ b/sound/usb/card.c
|
||||
@@ -382,6 +382,14 @@ static void usb_audio_make_shortname(struct usb_device *dev,
|
||||
}
|
||||
|
||||
strim(card->shortname);
|
||||
+
|
||||
+ /* Tinker Board ALC4040 CODEC */
|
||||
+
|
||||
+ if(USB_ID_VENDOR(chip->usb_id) == 0x0bda &&
|
||||
+ USB_ID_PRODUCT(chip->usb_id) == 0x481a) {
|
||||
+ strlcat(card->shortname, " OnBoard", sizeof(card->shortname));
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
static void usb_audio_make_longname(struct usb_device *dev,
|
||||
@@ -0,0 +1,26 @@
|
||||
From e5c9702bd2ffd09e48c118ab40c2764590af7929 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sat, 1 May 2021 12:41:14 +0000
|
||||
Subject: [PATCH] Workaround to make several broadcom bluetooth serdev devices
|
||||
work even without proper MAC address
|
||||
|
||||
---
|
||||
drivers/bluetooth/btbcm.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
|
||||
index 1b9743b7f..b274f1cdd 100644
|
||||
--- a/drivers/bluetooth/btbcm.c
|
||||
+++ b/drivers/bluetooth/btbcm.c
|
||||
@@ -87,7 +87,7 @@ int btbcm_check_bdaddr(struct hci_dev *hdev)
|
||||
!bacmp(&bda->bdaddr, BDADDR_BCM43341B)) {
|
||||
bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
|
||||
&bda->bdaddr);
|
||||
- set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
|
||||
+ //set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
|
||||
}
|
||||
|
||||
kfree_skb(skb);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From 3f6f9e704daf85eb5f45aba07997c85d927c880f Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Fri, 17 Sep 2021 20:10:22 +0000
|
||||
Subject: [PATCH] prefer 8-bit RGB over YCbCr
|
||||
|
||||
---
|
||||
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
index 84cc52858..5db7024de 100644
|
||||
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
||||
@@ -2648,6 +2648,10 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
|
||||
output_fmts[i++] = MEDIA_BUS_FMT_RGB101010_1X30;
|
||||
}
|
||||
|
||||
+ /* Prefer 8-bit RGB over YCbCr formats */
|
||||
+ if (is_tmds_allowed(info, mode, MEDIA_BUS_FMT_RGB888_1X24))
|
||||
+ output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24;
|
||||
+
|
||||
if ((info->color_formats & DRM_COLOR_FORMAT_YCRCB422) &&
|
||||
is_tmds_allowed(info, mode, MEDIA_BUS_FMT_UYVY8_1X16))
|
||||
output_fmts[i++] = MEDIA_BUS_FMT_UYVY8_1X16;
|
||||
@@ -2656,10 +2660,6 @@ static u32 *dw_hdmi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge,
|
||||
is_tmds_allowed(info, mode, MEDIA_BUS_FMT_YUV8_1X24))
|
||||
output_fmts[i++] = MEDIA_BUS_FMT_YUV8_1X24;
|
||||
|
||||
- /* Default 8bit RGB fallback */
|
||||
- if (is_tmds_allowed(info, mode, MEDIA_BUS_FMT_RGB888_1X24))
|
||||
- output_fmts[i++] = MEDIA_BUS_FMT_RGB888_1X24;
|
||||
-
|
||||
*num_output_fmts = i;
|
||||
|
||||
return output_fmts;
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
|
||||
index 58bd91539..9c0dac199 100644
|
||||
--- a/arch/arm/boot/dts/rk3288.dtsi
|
||||
+++ b/arch/arm/boot/dts/rk3288.dtsi
|
||||
@@ -153,6 +153,75 @@
|
||||
opp-hz = /bits/ 64 <1608000000>;
|
||||
opp-microvolt = <1350000>;
|
||||
};
|
||||
+ opp@1704000000 {
|
||||
+ opp-hz = /bits/ 64 <1704000000>;
|
||||
+ opp-microvolt = <1350000>;
|
||||
+ };
|
||||
+ opp@1800000000 {
|
||||
+ opp-hz = /bits/ 64 <1800000000>;
|
||||
+ opp-microvolt = <1400000>;
|
||||
+ };
|
||||
+ /* boot-only frequencies below */
|
||||
+ opp@1896000000 {
|
||||
+ opp-hz = /bits/ 64 <1896000000>;
|
||||
+ opp-microvolt = <1425000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@1920000000 {
|
||||
+ opp-hz = /bits/ 64 <1920000000>;
|
||||
+ opp-microvolt = <1425000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@1992000000 {
|
||||
+ opp-hz = /bits/ 64 <1992000000>;
|
||||
+ opp-microvolt = <1450000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@2016000000 {
|
||||
+ opp-hz = /bits/ 64 <2016000000>;
|
||||
+ opp-microvolt = <1475000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@2040000000 {
|
||||
+ opp-hz = /bits/ 64 <2040000000>;
|
||||
+ opp-microvolt = <1475000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@2064000000 {
|
||||
+ opp-hz = /bits/ 64 <2064000000>;
|
||||
+ opp-microvolt = <1475000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@2088000000 {
|
||||
+ opp-hz = /bits/ 64 <2088000000>;
|
||||
+ opp-microvolt = <1500000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@2112000000 {
|
||||
+ opp-hz = /bits/ 64 <2112000000>;
|
||||
+ opp-microvolt = <1500000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@2136000000 {
|
||||
+ opp-hz = /bits/ 64 <2136000000>;
|
||||
+ opp-microvolt = <1500000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@2160000000 {
|
||||
+ opp-hz = /bits/ 64 <2160000000>;
|
||||
+ opp-microvolt = <1500000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@2184000000 {
|
||||
+ opp-hz = /bits/ 64 <2184000000>;
|
||||
+ opp-microvolt = <1500000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
+ opp@2208000000 {
|
||||
+ opp-hz = /bits/ 64 <2208000000>;
|
||||
+ opp-microvolt = <1500000>;
|
||||
+ turbo-mode;
|
||||
+ };
|
||||
};
|
||||
|
||||
amba {
|
||||
@@ -0,0 +1,23 @@
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
index a907d7b06..ec71996c7 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
@@ -619,13 +619,17 @@ BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
|
||||
BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
|
||||
BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
|
||||
|
||||
+/* AMPAK */
|
||||
+BRCMF_FW_DEF(AP6330, "brcmfmac-ap6330-sdio");
|
||||
+
|
||||
static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
|
||||
BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x0000001F, 43241B0),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x00000020, 43241B4),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0xFFFFFFC0, 43241B5),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_4329_CHIP_ID, 0xFFFFFFFF, 4329),
|
||||
- BRCMF_FW_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, 4330),
|
||||
+ BRCMF_FW_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFEF, 4330),
|
||||
+ BRCMF_FW_ENTRY(BRCM_CC_4330_CHIP_ID, 0x10, AP6330),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, 4334),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, 43340),
|
||||
BRCMF_FW_ENTRY(BRCM_CC_43341_CHIP_ID, 0xFFFFFFFF, 43340),
|
||||
@@ -0,0 +1,108 @@
|
||||
diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
|
||||
index 3c79f859..4e5c1d59 100644
|
||||
--- a/arch/arm/boot/.gitignore
|
||||
+++ b/arch/arm/boot/.gitignore
|
||||
@@ -3,3 +3,5 @@ zImage
|
||||
xipImage
|
||||
bootpImage
|
||||
uImage
|
||||
+*.dtb*
|
||||
+*.scr
|
||||
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
|
||||
index 50d580d77..94bd15617 100644
|
||||
--- a/scripts/Makefile.dtbinst
|
||||
+++ b/scripts/Makefile.dtbinst
|
||||
@@ -18,9 +18,12 @@ include scripts/Kbuild.include
|
||||
include $(src)/Makefile
|
||||
|
||||
dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
|
||||
+dtbos := $(addprefix $(dst)/, $(dtbo-y))
|
||||
+scrs := $(addprefix $(dst)/, $(scr-y))
|
||||
+readmes := $(addprefix $(dst)/, $(dtbotxt-y))
|
||||
subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
|
||||
|
||||
-__dtbs_install: $(dtbs) $(subdirs)
|
||||
+__dtbs_install: $(dtbs) $(dtbos) $(scrs) $(readmes) $(subdirs)
|
||||
@:
|
||||
|
||||
quiet_cmd_dtb_install = INSTALL $@
|
||||
@@ -29,6 +32,15 @@ quiet_cmd_dtb_install = INSTALL $@
|
||||
$(dst)/%.dtb: $(obj)/%.dtb
|
||||
$(call cmd,dtb_install)
|
||||
|
||||
+$(dst)/%.dtbo: $(obj)/%.dtbo
|
||||
+ $(call cmd,dtb_install)
|
||||
+
|
||||
+$(dst)/%.scr: $(obj)/%.scr
|
||||
+ $(call cmd,dtb_install)
|
||||
+
|
||||
+$(dst)/README.rockchip-overlays: $(src)/README.rockchip-overlays
|
||||
+ $(call cmd,dtb_install)
|
||||
+
|
||||
PHONY += $(subdirs)
|
||||
$(subdirs):
|
||||
$(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@)
|
||||
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
|
||||
index 58c05e5d..2b95dda9 100644
|
||||
--- a/scripts/Makefile.lib
|
||||
+++ b/scripts/Makefile.lib
|
||||
@@ -278,6 +278,9 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \
|
||||
# ---------------------------------------------------------------------------
|
||||
DTC ?= $(objtree)/scripts/dtc/dtc
|
||||
|
||||
+# Overlay support
|
||||
+DTC_FLAGS += -@ -Wno-unit_address_format -Wno-simple_bus_reg
|
||||
+
|
||||
# Disable noisy checks by default
|
||||
ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),)
|
||||
DTC_FLAGS += -Wno-unit_address_vs_reg \
|
||||
@@ -324,6 +327,23 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
|
||||
$(obj)/%.dtb: $(src)/%.dts FORCE
|
||||
$(call if_changed_dep,dtc)
|
||||
|
||||
+quiet_cmd_dtco = DTCO $@
|
||||
+cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \
|
||||
+ $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
|
||||
+ $(DTC) -O dtb -o $@ -b 0 \
|
||||
+ -i $(dir $<) $(DTC_FLAGS) \
|
||||
+ -d $(depfile).dtc.tmp $(dtc-tmp) ; \
|
||||
+ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
|
||||
+
|
||||
+$(obj)/%.dtbo: $(src)/%.dts FORCE
|
||||
+ $(call if_changed_dep,dtco)
|
||||
+
|
||||
+quiet_cmd_scr = MKIMAGE $@
|
||||
+cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@
|
||||
+
|
||||
+$(obj)/%.scr: $(src)/%.scr-cmd FORCE
|
||||
+ $(call if_changed,scr)
|
||||
+
|
||||
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
|
||||
|
||||
# Bzip2
|
||||
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
|
||||
index 41c50f9461e5..387659d5b252 100644
|
||||
--- a/scripts/Makefile.lib
|
||||
+++ b/scripts/Makefile.lib
|
||||
@@ -79,6 +79,9 @@ header-test-y += $(filter-out $(header-test-), \
|
||||
|
||||
extra-$(CONFIG_HEADER_TEST) += $(addsuffix .s, $(header-test-y) $(header-test-m))
|
||||
|
||||
+# Overlay targets
|
||||
+extra-y += $(dtbo-y) $(scr-y) $(dtbotxt-y)
|
||||
+
|
||||
# Add subdir path
|
||||
|
||||
extra-y := $(addprefix $(obj)/,$(extra-y))
|
||||
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
|
||||
index e8dd99201..1e45adf97 100644
|
||||
--- a/arch/arm/boot/dts/Makefile
|
||||
+++ b/arch/arm/boot/dts/Makefile
|
||||
@@ -977,6 +984,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
|
||||
rk3288-veyron-speedy.dtb \
|
||||
rk3288-veyron-tiger.dtb \
|
||||
rk3288-vyasa.dtb
|
||||
+subdir-y := $(dts-dirs) overlay
|
||||
dtb-$(CONFIG_ARCH_S3C24XX) += \
|
||||
s3c2416-smdk2416.dtb
|
||||
dtb-$(CONFIG_ARCH_S3C64XX) += \
|
||||
483
patch/kernel/archive/rockchip-5.17/general-add-overlays.patch
Normal file
483
patch/kernel/archive/rockchip-5.17/general-add-overlays.patch
Normal file
@@ -0,0 +1,483 @@
|
||||
From f714d89ebd3ee718cb7ab8574ec92407b50b5aee Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
||||
Date: Sun, 20 Mar 2022 09:30:24 +0000
|
||||
Subject: [PATCH] rk3288: general add overlays
|
||||
|
||||
---
|
||||
arch/arm/boot/dts/overlay/Makefile | 26 +++++++
|
||||
.../boot/dts/overlay/README.rockchip-overlays | 78 +++++++++++++++++++
|
||||
arch/arm/boot/dts/overlay/rockchip-ds1307.dts | 23 ++++++
|
||||
.../boot/dts/overlay/rockchip-fixup.scr-cmd | 4 +
|
||||
arch/arm/boot/dts/overlay/rockchip-i2c1.dts | 16 ++++
|
||||
arch/arm/boot/dts/overlay/rockchip-i2c4.dts | 16 ++++
|
||||
arch/arm/boot/dts/overlay/rockchip-spi0.dts | 16 ++++
|
||||
arch/arm/boot/dts/overlay/rockchip-spi2.dts | 16 ++++
|
||||
.../arm/boot/dts/overlay/rockchip-spidev0.dts | 35 +++++++++
|
||||
.../arm/boot/dts/overlay/rockchip-spidev2.dts | 35 +++++++++
|
||||
arch/arm/boot/dts/overlay/rockchip-uart1.dts | 16 ++++
|
||||
arch/arm/boot/dts/overlay/rockchip-uart2.dts | 16 ++++
|
||||
arch/arm/boot/dts/overlay/rockchip-uart3.dts | 16 ++++
|
||||
arch/arm/boot/dts/overlay/rockchip-uart4.dts | 16 ++++
|
||||
.../arm/boot/dts/overlay/rockchip-w1-gpio.dts | 23 ++++++
|
||||
15 files changed, 352 insertions(+)
|
||||
create mode 100644 arch/arm/boot/dts/overlay/Makefile
|
||||
create mode 100644 arch/arm/boot/dts/overlay/README.rockchip-overlays
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-ds1307.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-fixup.scr-cmd
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-i2c1.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-i2c4.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-spi0.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-spi2.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-spidev0.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-spidev2.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-uart1.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-uart2.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-uart3.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-uart4.dts
|
||||
create mode 100644 arch/arm/boot/dts/overlay/rockchip-w1-gpio.dts
|
||||
|
||||
diff --git a/arch/arm/boot/dts/overlay/Makefile b/arch/arm/boot/dts/overlay/Makefile
|
||||
new file mode 100644
|
||||
index 00000000000..56d8cb187aa
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/Makefile
|
||||
@@ -0,0 +1,26 @@
|
||||
+# SPDX-License-Identifier: GPL-2.0
|
||||
+dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
|
||||
+ rockchip-ds1307.dtbo \
|
||||
+ rockchip-i2c1.dtbo \
|
||||
+ rockchip-i2c4.dtbo \
|
||||
+ rockchip-spi0.dtbo \
|
||||
+ rockchip-spi2.dtbo \
|
||||
+ rockchip-spidev0.dtbo \
|
||||
+ rockchip-spidev2.dtbo \
|
||||
+ rockchip-uart1.dtbo \
|
||||
+ rockchip-uart2.dtbo \
|
||||
+ rockchip-uart3.dtbo \
|
||||
+ rockchip-uart4.dtbo \
|
||||
+ rockchip-w1-gpio.dtbo
|
||||
+
|
||||
+scr-$(CONFIG_ARCH_ROCKCHIP) += \
|
||||
+ rockchip-fixup.scr
|
||||
+
|
||||
+dtbotxt-$(CONFIG_ARCH_ROCKCHIP) += \
|
||||
+ README.rockchip-overlays
|
||||
+
|
||||
+targets += $(dtbo-y) $(scr-y) $(dtbotxt-y)
|
||||
+
|
||||
+always := $(dtbo-y) $(scr-y) $(dtbotxt-y)
|
||||
+clean-files := *.dtbo *.scr
|
||||
+
|
||||
diff --git a/arch/arm/boot/dts/overlay/README.rockchip-overlays b/arch/arm/boot/dts/overlay/README.rockchip-overlays
|
||||
new file mode 100644
|
||||
index 00000000000..df4559ca262
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/README.rockchip-overlays
|
||||
@@ -0,0 +1,78 @@
|
||||
+This document describes overlays provided in the kernel packages
|
||||
+For generic Armbian overlays documentation please see
|
||||
+https://docs.armbian.com/User-Guide_Allwinner_overlays/
|
||||
+
|
||||
+### Platform:
|
||||
+
|
||||
+rockchip (Rockchip)
|
||||
+
|
||||
+### Provided overlays:
|
||||
+
|
||||
+- ds1307
|
||||
+- i2c1
|
||||
+- i2c4
|
||||
+- spi0
|
||||
+- spi2
|
||||
+- spidev0
|
||||
+- spidev2
|
||||
+- uart1
|
||||
+- uart2
|
||||
+- uart3
|
||||
+- uart4
|
||||
+- w1-gpio
|
||||
+
|
||||
+### Overlay details:
|
||||
+
|
||||
+### ds1307
|
||||
+
|
||||
+Activates ds1307 rtc on i2c1
|
||||
+
|
||||
+### i2c1
|
||||
+
|
||||
+Activate i2c1
|
||||
+
|
||||
+### i2c4
|
||||
+
|
||||
+Activate i2c4
|
||||
+
|
||||
+### spi0
|
||||
+
|
||||
+Activate spi0
|
||||
+conflicts with uart4
|
||||
+
|
||||
+### spi2
|
||||
+
|
||||
+Activate spi2
|
||||
+
|
||||
+### spidev0
|
||||
+
|
||||
+Activate spidev on spi0
|
||||
+Depends on spi0
|
||||
+
|
||||
+### spidev2
|
||||
+
|
||||
+Activate spidev on spi2
|
||||
+depends on spi2
|
||||
+
|
||||
+### uart1
|
||||
+
|
||||
+Activate uart1
|
||||
+
|
||||
+### uart2
|
||||
+
|
||||
+Activate uart2
|
||||
+
|
||||
+### uart3
|
||||
+
|
||||
+Activate uart3
|
||||
+
|
||||
+### uart4
|
||||
+
|
||||
+Activate uart4
|
||||
+Conflicts with spi0
|
||||
+
|
||||
+### w1-gpio
|
||||
+
|
||||
+Activates 1-wire gpio master on GPIO0 17
|
||||
+
|
||||
+
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-ds1307.dts b/arch/arm/boot/dts/overlay/rockchip-ds1307.dts
|
||||
new file mode 100644
|
||||
index 00000000000..ab7d648c2aa
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-ds1307.dts
|
||||
@@ -0,0 +1,23 @@
|
||||
+/* Definitions for ds1307
|
||||
+* From ASUS: https://github.com/TinkerBoard/debian_kernel/commits/develop/arch/arm/boot/dts/overlays/ds1307-overlay.dts
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target = <&i2c1>;
|
||||
+ __overlay__ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ rtc: ds1307@68 {
|
||||
+ compatible = "dallas,ds1307";
|
||||
+ reg = <0x68>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-fixup.scr-cmd b/arch/arm/boot/dts/overlay/rockchip-fixup.scr-cmd
|
||||
new file mode 100644
|
||||
index 00000000000..d4c39e20a3a
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-fixup.scr-cmd
|
||||
@@ -0,0 +1,4 @@
|
||||
+# overlays fixup script
|
||||
+# implements (or rather substitutes) overlay arguments functionality
|
||||
+# using u-boot scripting, environment variables and "fdt" command
|
||||
+
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-i2c1.dts b/arch/arm/boot/dts/overlay/rockchip-i2c1.dts
|
||||
new file mode 100644
|
||||
index 00000000000..f09f85e42cb
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-i2c1.dts
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* Definitions for i2c1
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target = <&i2c1>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-i2c4.dts b/arch/arm/boot/dts/overlay/rockchip-i2c4.dts
|
||||
new file mode 100644
|
||||
index 00000000000..5b43b85045f
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-i2c4.dts
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* Definitions for i2c4
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target = <&i2c4>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-spi0.dts b/arch/arm/boot/dts/overlay/rockchip-spi0.dts
|
||||
new file mode 100644
|
||||
index 00000000000..d2dfcd6220e
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-spi0.dts
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* Definitions for spi0
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target = <&spi0>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-spi2.dts b/arch/arm/boot/dts/overlay/rockchip-spi2.dts
|
||||
new file mode 100644
|
||||
index 00000000000..2cd50ae4b9d
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-spi2.dts
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* Definitions for spi2
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target = <&spi2>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-spidev0.dts b/arch/arm/boot/dts/overlay/rockchip-spidev0.dts
|
||||
new file mode 100644
|
||||
index 00000000000..728cde52351
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-spidev0.dts
|
||||
@@ -0,0 +1,35 @@
|
||||
+/* Definition for SPI0 Spidev
|
||||
+ * spi port for Tinker Board
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/{
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+
|
||||
+ target = <&spi0>;
|
||||
+ __overlay__ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ spidev@0 {
|
||||
+ compatible = "rockchip,spi_tinker";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <50000000>;
|
||||
+ spi-cpha = <1>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ spidev@1 {
|
||||
+ compatible = "rockchip,spi_tinker";
|
||||
+ reg = <1>;
|
||||
+ spi-max-frequency = <50000000>;
|
||||
+ spi-cpha = <1>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-spidev2.dts b/arch/arm/boot/dts/overlay/rockchip-spidev2.dts
|
||||
new file mode 100644
|
||||
index 00000000000..262bb61d959
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-spidev2.dts
|
||||
@@ -0,0 +1,35 @@
|
||||
+/* Definition for SPI2 Spidev
|
||||
+ * spi port for Tinker Board
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/{
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+
|
||||
+ target = <&spi2>;
|
||||
+ __overlay__ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ spidev@0 {
|
||||
+ compatible = "rockchip,spi_tinker";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <50000000>;
|
||||
+ spi-cpha = <1>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ spidev@1 {
|
||||
+ compatible = "rockchip,spi_tinker";
|
||||
+ reg = <1>;
|
||||
+ spi-max-frequency = <50000000>;
|
||||
+ spi-cpha = <1>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-uart1.dts b/arch/arm/boot/dts/overlay/rockchip-uart1.dts
|
||||
new file mode 100644
|
||||
index 00000000000..8604ff90d2a
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-uart1.dts
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* Definitions for uart1
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target = <&uart1>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-uart2.dts b/arch/arm/boot/dts/overlay/rockchip-uart2.dts
|
||||
new file mode 100644
|
||||
index 00000000000..a57873d560b
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-uart2.dts
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* Definitions for uart2
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target = <&uart2>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-uart3.dts b/arch/arm/boot/dts/overlay/rockchip-uart3.dts
|
||||
new file mode 100644
|
||||
index 00000000000..d1b77ffbf31
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-uart3.dts
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* Definitions for uart3
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target = <&uart3>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-uart4.dts b/arch/arm/boot/dts/overlay/rockchip-uart4.dts
|
||||
new file mode 100644
|
||||
index 00000000000..13fd8f4eca9
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-uart4.dts
|
||||
@@ -0,0 +1,16 @@
|
||||
+/* Definitions for uart4
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+
|
||||
+ fragment@0 {
|
||||
+ target = <&uart4>;
|
||||
+ __overlay__ {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
diff --git a/arch/arm/boot/dts/overlay/rockchip-w1-gpio.dts b/arch/arm/boot/dts/overlay/rockchip-w1-gpio.dts
|
||||
new file mode 100644
|
||||
index 00000000000..cc1f50a91bb
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/overlay/rockchip-w1-gpio.dts
|
||||
@@ -0,0 +1,23 @@
|
||||
+/* 1-Wire GPIO
|
||||
+* From ASUS: https://github.com/TinkerBoard/debian_kernel/blob/develop/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts
|
||||
+*
|
||||
+*
|
||||
+*/
|
||||
+
|
||||
+/dts-v1/;
|
||||
+/plugin/;
|
||||
+
|
||||
+/ {
|
||||
+ compatible = "rockchip,rk3288";
|
||||
+ fragment@0 {
|
||||
+ target-path = "/";
|
||||
+ __overlay__ {
|
||||
+ w1: onewire@0 {
|
||||
+ compatible = "w1-gpio";
|
||||
+ pinctrl-names = "default";
|
||||
+ gpios = <&gpio0 17 0>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
|
||||
index 5bd58b95d..48ebe081f 100644
|
||||
--- a/drivers/mmc/core/core.c
|
||||
+++ b/drivers/mmc/core/core.c
|
||||
@@ -1684,6 +1684,14 @@ void mmc_power_off(struct mmc_host *host)
|
||||
if (host->ios.power_mode == MMC_POWER_OFF)
|
||||
return;
|
||||
|
||||
+ mmc_set_initial_signal_voltage(host);
|
||||
+
|
||||
+ /*
|
||||
+ * This delay should be sufficient to allow the power supply
|
||||
+ * to reach the minimum voltage.
|
||||
+ */
|
||||
+ mmc_delay(host->ios.power_delay_ms);
|
||||
+
|
||||
mmc_pwrseq_power_off(host);
|
||||
|
||||
host->ios.clock = 0;
|
||||
1134
patch/kernel/archive/rockchip-5.17/xt-q8l-v10-add-device-tree.patch
Normal file
1134
patch/kernel/archive/rockchip-5.17/xt-q8l-v10-add-device-tree.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
|
||||
index 37a3de760..6bcfceede 100644
|
||||
--- a/arch/arm/boot/dts/Makefile
|
||||
+++ b/arch/arm/boot/dts/Makefile
|
||||
@@ -832,6 +832,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
|
||||
rk3188-radxarock.dtb \
|
||||
rk3228-evb.dtb \
|
||||
rk3229-evb.dtb \
|
||||
+ rk3288-xt-q8l-v10.dtb \
|
||||
rk3229-xms6.dtb \
|
||||
rk3288-evb-act8846.dtb \
|
||||
rk3288-evb-rk808.dtb \
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
diff --git a/drivers/media/rc/keymaps/rc-xt-q8l-v10.c b/drivers/media/rc/keymaps/rc-xt-q8l-v10.c
|
||||
index e69de29..19c7d9e 100644
|
||||
--- /dev/null
|
||||
+++ b/drivers/media/rc/keymaps/rc-xt-q8l-v10.c
|
||||
@@ -0,0 +1,76 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0+
|
||||
+// rc-xt-q8l-v10.c - Keytable for xt-q8l-v10 tv box remote controller
|
||||
+//
|
||||
+// keymap imported from ir-keymaps.c
|
||||
+//
|
||||
+// Copyright (c) 2018 Paolo Sabatino
|
||||
+
|
||||
+#include <media/rc-map.h>
|
||||
+#include <linux/module.h>
|
||||
+
|
||||
+/*
|
||||
+
|
||||
+*/
|
||||
+
|
||||
+static struct rc_map_table xt_q8l_v10[] = {
|
||||
+
|
||||
+ { 0xcc1d11, KEY_ENTER },
|
||||
+ { 0xcc1d00, KEY_POWER },
|
||||
+ { 0xcc1d15, KEY_PLAYPAUSE },
|
||||
+ { 0xcc1d16, KEY_STOP },
|
||||
+ { 0xcc1d06, KEY_PREVIOUSSONG },
|
||||
+ { 0xcc1d0a, KEY_NEXTSONG },
|
||||
+ { 0xcc1d41, KEY_1 },
|
||||
+ { 0xcc1d45, KEY_2 },
|
||||
+ { 0xcc1d4d, KEY_3 },
|
||||
+ { 0xcc1d42, KEY_4 },
|
||||
+ { 0xcc1d46, KEY_5 },
|
||||
+ { 0xcc1d4e, KEY_6 },
|
||||
+ { 0xcc1d43, KEY_7 },
|
||||
+ { 0xcc1d47, KEY_8 },
|
||||
+ { 0xcc1d4f, KEY_9 },
|
||||
+ { 0xcc1d49, KEY_0 },
|
||||
+ { 0xcc1d4a, KEY_BACKSPACE },
|
||||
+ { 0xcc1d48, KEY_F6 },
|
||||
+ { 0xcc1d03, KEY_HOME },
|
||||
+ { 0xcc1d0f, KEY_BACK },
|
||||
+ { 0xcc1d40, KEY_MENU },
|
||||
+ { 0xcc1d4c, KEY_TEXT },
|
||||
+ { 0xcc1d10, KEY_LEFT },
|
||||
+ { 0xcc1d12, KEY_RIGHT },
|
||||
+ { 0xcc1d44, KEY_DOWN },
|
||||
+ { 0xcc1d07, KEY_UP },
|
||||
+ { 0xcc1d02, KEY_VOLUMEDOWN },
|
||||
+ { 0xcc1d0c, KEY_MUTE },
|
||||
+ { 0xcc1d0e, KEY_VOLUMEUP },
|
||||
+ { 0xcc1d01, KEY_F1 },
|
||||
+ { 0xcc1d05, KEY_F2 },
|
||||
+ { 0xcc1d09, KEY_F3 },
|
||||
+ { 0xcc1d0d, KEY_F4 },
|
||||
+
|
||||
+};
|
||||
+
|
||||
+static struct rc_map_list xt_q8l_v10_map = {
|
||||
+ .map = {
|
||||
+ .scan = xt_q8l_v10,
|
||||
+ .size = ARRAY_SIZE(xt_q8l_v10),
|
||||
+ .rc_proto = RC_PROTO_NEC, /* Legacy IR type */
|
||||
+ .name = RC_MAP_XT_Q8L_V10,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static int __init init_rc_map_xt_q8l_v10(void)
|
||||
+{
|
||||
+ return rc_map_register(&xt_q8l_v10_map);
|
||||
+}
|
||||
+
|
||||
+static void __exit exit_rc_map_xt_q8l_v10(void)
|
||||
+{
|
||||
+ rc_map_unregister(&xt_q8l_v10_map);
|
||||
+}
|
||||
+
|
||||
+module_init(init_rc_map_xt_q8l_v10)
|
||||
+module_exit(exit_rc_map_xt_q8l_v10)
|
||||
+
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_AUTHOR("Paolo Sabatino");
|
||||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
|
||||
index d621acadf..ad7abdb97 100644
|
||||
--- a/include/media/rc-map.h
|
||||
+++ b/include/media/rc-map.h
|
||||
@@ -278,6 +278,7 @@ struct rc_map *rc_map_get(const char *name);
|
||||
#define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe"
|
||||
#define RC_MAP_X96MAX "rc-x96max"
|
||||
#define RC_MAP_XBOX_DVD "rc-xbox-dvd"
|
||||
+#define RC_MAP_XT_Q8L_V10 "rc-xt-q8l-v10"
|
||||
#define RC_MAP_ZX_IRDEC "rc-zx-irdec"
|
||||
|
||||
/*
|
||||
diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
|
||||
index 5b1399af6..ec9ce1206 100644
|
||||
--- a/drivers/media/rc/keymaps/Makefile
|
||||
+++ b/drivers/media/rc/keymaps/Makefile
|
||||
@@ -117,4 +117,5 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
|
||||
rc-winfast-usbii-deluxe.o \
|
||||
rc-su3000.o \
|
||||
rc-xbox-dvd.o \
|
||||
+ rc-xt-q8l-v10.o \
|
||||
rc-x96max.o \
|
||||
@@ -1 +1 @@
|
||||
archive/rockchip-5.16
|
||||
archive/rockchip-5.17
|
||||
Reference in New Issue
Block a user