Merge commit 'd7e2ada39537a54426c3a25f20dbb2d1d19d309d'

* commit 'd7e2ada39537a54426c3a25f20dbb2d1d19d309d':
  arm64: dts: rockchip: rk3588 boards: fix maximum-speed for usbdp node
  arm64: dts: rockchip: AMP memory use reserved-memory
  driver: rknpu: Update rknpu driver, version: 0.9.5
  arm64: dts: rockchip: rk356x boards: Fix to regulator to unique name
  mfd: display-serdes: delete the interface that GKI not supported

Change-Id: Ifbf2f6279906ca26b8106c8441a859f8394f5ec7
This commit is contained in:
Tao Huang
2024-03-01 18:44:25 +08:00
32 changed files with 118 additions and 114 deletions

View File

@@ -10,10 +10,15 @@
#include "rk3562-amp.dtsi"
/ {
memory {
device_type = "memory";
reg = <0x0 0x02000000 0x0 0x06400000>,
<0x0 0x0a200000 0x0 0xf1e00000>;
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
amp_reserved: amp@800000 {
reg = <0x0 0x00800000 0x0 0x01800000>;
no-map;
};
};
};

View File

@@ -11,10 +11,15 @@
#include "rk3562-amp.dtsi"
/ {
memory {
device_type = "memory";
reg = <0x0 0x02000000 0x0 0x04b80000>,
<0x0 0x0a200000 0x0 0x75e00000>;
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
amp_reserved: amp@800000 {
reg = <0x0 0x00800000 0x0 0x01800000>;
no-map;
};
};
};

View File

@@ -14,7 +14,7 @@
model = "Rockchip RK3566 EVB MIPITEST V10 Board";
compatible = "rockchip,rk3566-evb-mipitest-v10", "rockchip,rk3566";
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -14,7 +14,7 @@
model = "Rockchip RK3566 EVB1 DDR4 V10 Board";
compatible = "rockchip,rk3566-evb1-ddr4-v10", "rockchip,rk3566";
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -27,7 +27,7 @@
regulator-boot-on;
};
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -14,7 +14,7 @@
model = "Rockchip RK3566 EVB5 LP4X V10 Board";
compatible = "rockchip,rk3566-evb5-lp4x-v10", "rockchip,rk3566";
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -27,7 +27,7 @@
regulator-boot-on;
};
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -8,10 +8,15 @@
#include "rk3568-amp.dtsi"
/ {
memory {
device_type = "memory";
reg = <0x0 0x03880000 0x0 0x04b80000>,
<0x0 0x0a200000 0x0 0x75e00000>;
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
amp_reserved: amp@1800000 {
reg = <0x0 0x01800000 0x0 0x01800000>;
no-map;
};
};
};

View File

@@ -55,7 +55,7 @@
vin-supply = <&vcc3v3_sys>;
};
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -32,7 +32,7 @@
vin-supply = <&vcc3v3_sys>;
};
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;
@@ -43,7 +43,7 @@
vin-supply = <&dc_12v>;
};
qsgmii_3v3: gpio-regulator {
qsgmii_3v3: qsgmii-3v3 {
compatible = "regulator-gpio";
regulator-name = "qsgmii_3v3";
regulator-min-microvolt = <0100000>;

View File

@@ -52,7 +52,7 @@
vin-supply = <&vcc3v3_sys>;
};
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -20,7 +20,7 @@
pinctrl-0 = <&hp_det>;
};
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -54,7 +54,7 @@
vin-supply = <&vcc3v3_sys>;
};
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -94,7 +94,7 @@
status = "okay";
};
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -51,7 +51,7 @@
vin-supply = <&vcc3v3_sys>;
};
pcie30_3v3: gpio-regulator {
pcie30_3v3: pcie30-3v3 {
compatible = "regulator-gpio";
regulator-name = "pcie30_3v3";
regulator-min-microvolt = <100000>;
@@ -80,7 +80,7 @@
vin-supply = <&vcc3v3_sys>;
};
vcc3v3_pcie: gpio-regulator {
vcc3v3_pcie: vcc3v3-pcie {
compatible = "regulator-fixed";
regulator-name = "vcc3v3_pcie";
regulator-min-microvolt = <3300000>;

View File

@@ -66,7 +66,7 @@
};
};
pcie20_3v3: gpio-regulator {
pcie20_3v3: pcie20-3v3 {
compatible = "regulator-gpio";
regulator-name = "pcie20_3v3";
regulator-min-microvolt = <100000>;
@@ -97,7 +97,7 @@
vin-supply = <&vcc3v3_sys>;
};
pcie30_3v3: gpio-regulator {
pcie30_3v3: pcie30-3v3 {
compatible = "regulator-gpio";
regulator-name = "pcie30_3v3";
regulator-min-microvolt = <100000>;

View File

@@ -23,12 +23,15 @@
};
};
memory {
device_type = "memory";
reg = <0x0 0x02000000 0x0 0x06400000>,
<0x0 0x09400000 0x0 0xe6c00000>,
<0x1 0x00000000 0x1 0x00000000>,
<0x2 0xf0000000 0x0 0x10000000>;
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
amp_reserved: amp@800000 {
reg = <0x0 0x00800000 0x0 0x01800000>;
no-map;
};
};
};

View File

@@ -828,6 +828,7 @@
};
&usbdp_phy1 {
maximum-speed = "high-speed";
rockchip,dp-lane-mux = <3 2 1 0>;
status = "okay";
};
@@ -837,7 +838,6 @@
};
&usbdp_phy1_u3 {
maximum-speed = "high-speed";
status = "okay";
};

View File

@@ -795,6 +795,7 @@
};
&usbdp_phy1 {
maximum-speed = "high-speed";
rockchip,dp-lane-mux = < 0 1 2 3 >;
status = "okay";
};
@@ -804,7 +805,6 @@
};
&usbdp_phy1_u3 {
maximum-speed = "high-speed";
status = "okay";
};

View File

@@ -368,6 +368,7 @@
};
&usbdp_phy1 {
maximum-speed = "high-speed";
rockchip,dp-lane-mux = <3 2 1 0>;
status = "okay";
};
@@ -377,7 +378,6 @@
};
&usbdp_phy1_u3 {
maximum-speed = "high-speed";
status = "okay";
};

View File

@@ -388,6 +388,7 @@
};
&usbdp_phy1 {
maximum-speed = "high-speed";
rockchip,dp-lane-mux = <3 2 1 0>;
status = "okay";
};
@@ -397,7 +398,6 @@
};
&usbdp_phy1_u3 {
maximum-speed = "high-speed";
status = "okay";
};

View File

@@ -647,6 +647,7 @@
};
&usbdp_phy1 {
maximum-speed = "high-speed";
rockchip,dp-lane-mux = <3 2 1 0>;
status = "okay";
};
@@ -656,7 +657,6 @@
};
&usbdp_phy1_u3 {
maximum-speed = "high-speed";
status = "okay";
};

View File

@@ -224,6 +224,7 @@
};
&usbdp_phy1 {
maximum-speed = "high-speed";
rockchip,dp-lane-mux = <3 2 1 0>;
status = "disabled";
};
@@ -233,7 +234,6 @@
};
&usbdp_phy1_u3 {
maximum-speed = "high-speed";
status = "okay";
};

View File

@@ -187,7 +187,8 @@ static void serdes_bridge_enable(struct drm_bridge *bridge)
if (!ret) {
extcon_set_state_sync(serdes->extcon, EXTCON_JACK_VIDEO_OUT, true);
SERDES_DBG_MFD("%s: extcon is true\n", __func__);
SERDES_DBG_MFD("%s: %s-%s extcon is true\n", __func__, dev_name(serdes->dev),
serdes->chip_data->name);
}
SERDES_DBG_MFD("%s: %s-%s ret=%d\n", __func__, dev_name(serdes->dev),
@@ -204,6 +205,9 @@ serdes_bridge_detect(struct drm_bridge *bridge)
if (serdes->chip_data->bridge_ops->detect)
status = serdes->chip_data->bridge_ops->detect(serdes);
SERDES_DBG_MFD("%s:%s %s, %s\n", __func__, dev_name(serdes->dev),
serdes->chip_data->name,
(status == connector_status_connected) ? "connected" : "disconnect");
return status;
}
@@ -223,7 +227,7 @@ static int serdes_bridge_get_modes(struct drm_bridge *bridge,
if (serdes_bridge->panel)
ret = drm_panel_get_modes(serdes_bridge->panel, connector);
SERDES_DBG_MFD("%s:name=%s, node=%s\n", __func__,
SERDES_DBG_MFD("%s:%s %s, node=%s\n", __func__, dev_name(serdes->dev),
serdes->chip_data->name, serdes_bridge->dev->of_node->name);
return ret;

View File

@@ -108,18 +108,9 @@ static void serdes_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
for (i = 0; i < chip->ngpio; i++) {
int gpio = i + chip->base;
const char *label, *level;
const char *level;
/* We report the GPIO even if it's not requested since
* we're also reporting things like alternate
* functions which apply even when the GPIO is not in
* use as a GPIO.
*/
label = gpiochip_is_requested(chip, i);
if (!label)
label = "Unrequested";
seq_printf(s, " %s-gpio-%02d ", label, gpio);
seq_printf(s, "gpio-%02d ", gpio);
if (serdes->chip_data->gpio_ops->get_level)
ret = serdes->chip_data->gpio_ops->get_level(serdes, i);

View File

@@ -213,7 +213,7 @@ static int serdes_panel_split_probe(struct platform_device *pdev)
if (ret)
return dev_err_probe(dev, ret, "failed to parse serdes DT\n");
serdes_panel_split->backlight = devm_of_find_backlight(dev);
serdes_panel_split->backlight = of_find_backlight_by_node(dev->of_node);
if (IS_ERR(serdes_panel_split->backlight))
return dev_err_probe(dev, PTR_ERR(serdes_panel_split->backlight),
"failed to get serdes backlight\n");
@@ -236,6 +236,10 @@ static int serdes_panel_split_probe(struct platform_device *pdev)
static int serdes_panel_split_remove(struct platform_device *pdev)
{
struct serdes_panel_split *serdes_panel_split = platform_get_drvdata(pdev);
struct backlight_device *backlight = serdes_panel_split->backlight;
if (backlight)
put_device(&backlight->dev);
drm_panel_remove(&serdes_panel_split->panel);

View File

@@ -219,7 +219,7 @@ static int serdes_panel_probe(struct platform_device *pdev)
if (ret)
return dev_err_probe(dev, ret, "failed to parse serdes DT\n");
serdes_panel->backlight = devm_of_find_backlight(dev);
serdes_panel->backlight = of_find_backlight_by_node(dev->of_node);
if (IS_ERR(serdes_panel->backlight))
return dev_err_probe(dev, PTR_ERR(serdes_panel->backlight),
"failed to get serdes backlight\n");
@@ -242,6 +242,10 @@ static int serdes_panel_probe(struct platform_device *pdev)
static int serdes_panel_remove(struct platform_device *pdev)
{
struct serdes_panel *serdes_panel = platform_get_drvdata(pdev);
struct backlight_device *backlight = serdes_panel->backlight;
if (backlight)
put_device(&backlight->dev);
drm_panel_remove(&serdes_panel->panel);

View File

@@ -29,10 +29,10 @@
#define DRIVER_NAME "rknpu"
#define DRIVER_DESC "RKNPU driver"
#define DRIVER_DATE "20240129"
#define DRIVER_DATE "20240226"
#define DRIVER_MAJOR 0
#define DRIVER_MINOR 9
#define DRIVER_PATCHLEVEL 4
#define DRIVER_PATCHLEVEL 5
#define LOG_TAG "RKNPU"
@@ -58,11 +58,6 @@ struct rknpu_irqs_data {
irqreturn_t (*irq_hdl)(int irq, void *ctx);
};
struct rknpu_reset_data {
const char *srst_a_name;
const char *srst_h_name;
};
struct rknpu_amount_data {
uint16_t offset_clr_all;
uint16_t offset_dt_wr;
@@ -80,9 +75,7 @@ struct rknpu_config {
__u32 pc_task_status_offset;
__u32 pc_dma_ctrl;
const struct rknpu_irqs_data *irqs;
const struct rknpu_reset_data *resets;
int num_irqs;
int num_resets;
__u64 nbuf_phyaddr;
__u64 nbuf_size;
__u64 max_submit_number;
@@ -132,8 +125,8 @@ struct rknpu_device {
void __iomem *bw_priority_base;
struct rknpu_fence_context *fence_ctx;
bool iommu_en;
struct reset_control *srst_a[RKNPU_MAX_CORES];
struct reset_control *srst_h[RKNPU_MAX_CORES];
struct reset_control **srsts;
int num_srsts;
struct clk_bulk_data *clks;
int num_clks;
struct regulator *vdd;

View File

@@ -162,7 +162,6 @@ static int rk3588_npu_set_read_margin(struct device *dev,
struct rockchip_opp_info *opp_info,
u32 rm)
{
struct rknpu_device *rknpu_dev = dev_get_drvdata(dev);
u32 offset = 0, val = 0;
int i, ret = 0;
@@ -174,7 +173,7 @@ static int rk3588_npu_set_read_margin(struct device *dev,
LOG_DEV_DEBUG(dev, "set rm to %d\n", rm);
for (i = 0; i < rknpu_dev->config->num_irqs; i++) {
for (i = 0; i < 3; i++) {
ret = regmap_read(opp_info->grf, offset, &val);
if (ret < 0) {
LOG_DEV_ERROR(dev, "failed to get rm from 0x%x\n",

View File

@@ -81,15 +81,6 @@ static const struct rknpu_irqs_data rk3588_npu_irqs[] = {
{ "npu2_irq", rknpu_core2_irq_handler }
};
static const struct rknpu_reset_data rknpu_resets[] = { { "srst_a",
"srst_h" } };
static const struct rknpu_reset_data rk3588_npu_resets[] = {
{ "srst_a0", "srst_h0" },
{ "srst_a1", "srst_h1" },
{ "srst_a2", "srst_h2" }
};
static const struct rknpu_amount_data rknpu_old_top_amount = {
.offset_clr_all = 0x8010,
.offset_dt_wr = 0x8034,
@@ -121,9 +112,7 @@ static const struct rknpu_config rk356x_rknpu_config = {
.pc_task_status_offset = 0x3c,
.pc_dma_ctrl = 0,
.irqs = rknpu_irqs,
.resets = rknpu_resets,
.num_irqs = ARRAY_SIZE(rknpu_irqs),
.num_resets = ARRAY_SIZE(rknpu_resets),
.nbuf_phyaddr = 0,
.nbuf_size = 0,
.max_submit_number = (1 << 12) - 1,
@@ -142,9 +131,7 @@ static const struct rknpu_config rk3588_rknpu_config = {
.pc_task_status_offset = 0x3c,
.pc_dma_ctrl = 0,
.irqs = rk3588_npu_irqs,
.resets = rk3588_npu_resets,
.num_irqs = ARRAY_SIZE(rk3588_npu_irqs),
.num_resets = ARRAY_SIZE(rk3588_npu_resets),
.nbuf_phyaddr = 0,
.nbuf_size = 0,
.max_submit_number = (1 << 12) - 1,
@@ -163,9 +150,7 @@ static const struct rknpu_config rk3583_rknpu_config = {
.pc_task_status_offset = 0x3c,
.pc_dma_ctrl = 0,
.irqs = rk3588_npu_irqs,
.resets = rk3588_npu_resets,
.num_irqs = 2,
.num_resets = 2,
.nbuf_phyaddr = 0,
.nbuf_size = 0,
.max_submit_number = (1 << 12) - 1,
@@ -184,9 +169,7 @@ static const struct rknpu_config rv1106_rknpu_config = {
.pc_task_status_offset = 0x3c,
.pc_dma_ctrl = 0,
.irqs = rknpu_irqs,
.resets = rknpu_resets,
.num_irqs = ARRAY_SIZE(rknpu_irqs),
.num_resets = ARRAY_SIZE(rknpu_resets),
.nbuf_phyaddr = 0,
.nbuf_size = 0,
.max_submit_number = (1 << 16) - 1,
@@ -205,9 +188,7 @@ static const struct rknpu_config rk3562_rknpu_config = {
.pc_task_status_offset = 0x48,
.pc_dma_ctrl = 1,
.irqs = rknpu_irqs,
.resets = rknpu_resets,
.num_irqs = ARRAY_SIZE(rknpu_irqs),
.num_resets = ARRAY_SIZE(rknpu_resets),
.nbuf_phyaddr = 0xfe400000,
.nbuf_size = 256 * 1024,
.max_submit_number = (1 << 16) - 1,

View File

@@ -128,6 +128,7 @@ static inline struct rknpu_job *rknpu_job_alloc(struct rknpu_device *rknpu_dev,
struct rknpu_submit *args)
{
struct rknpu_job *job = NULL;
int i = 0;
#ifdef CONFIG_ROCKCHIP_RKNPU_DRM_GEM
struct rknpu_gem_object *task_obj = NULL;
#endif
@@ -143,6 +144,8 @@ static inline struct rknpu_job *rknpu_job_alloc(struct rknpu_device *rknpu_dev,
((args->core_mask & RKNPU_CORE2_MASK) >> 2);
atomic_set(&job->run_count, job->use_core_num);
atomic_set(&job->interrupt_count, job->use_core_num);
for (i = 0; i < rknpu_dev->config->num_irqs; i++)
atomic_set(&job->submit_count[i], 0);
#ifdef CONFIG_ROCKCHIP_RKNPU_DRM_GEM
task_obj = (struct rknpu_gem_object *)(uintptr_t)args->task_obj_addr;
if (task_obj)

View File

@@ -28,27 +28,34 @@ static inline struct reset_control *rknpu_reset_control_get(struct device *dev,
int rknpu_reset_get(struct rknpu_device *rknpu_dev)
{
#ifndef FPGA_PLATFORM
struct reset_control *srst_a = NULL;
struct reset_control *srst_h = NULL;
int i = 0;
int num_srsts = 0;
for (i = 0; i < rknpu_dev->config->num_resets; i++) {
srst_a = rknpu_reset_control_get(
rknpu_dev->dev,
rknpu_dev->config->resets[i].srst_a_name);
if (IS_ERR(srst_a))
return PTR_ERR(srst_a);
rknpu_dev->srst_a[i] = srst_a;
srst_h = rknpu_reset_control_get(
rknpu_dev->dev,
rknpu_dev->config->resets[i].srst_h_name);
if (IS_ERR(srst_h))
return PTR_ERR(srst_h);
rknpu_dev->srst_h[i] = srst_h;
num_srsts = of_count_phandle_with_args(rknpu_dev->dev->of_node,
"resets", "#reset-cells");
if (num_srsts <= 0) {
LOG_DEV_ERROR(rknpu_dev->dev,
"failed to get rknpu resets from dtb\n");
return num_srsts;
}
rknpu_dev->srsts = devm_kcalloc(rknpu_dev->dev, num_srsts,
sizeof(*rknpu_dev->srsts), GFP_KERNEL);
if (!rknpu_dev->srsts)
return -ENOMEM;
for (i = 0; i < num_srsts; ++i) {
rknpu_dev->srsts[i] = devm_reset_control_get_exclusive_by_index(
rknpu_dev->dev, i);
if (IS_ERR(rknpu_dev->srsts[i])) {
rknpu_dev->num_srsts = i;
return PTR_ERR(rknpu_dev->srsts[i]);
}
}
rknpu_dev->num_srsts = num_srsts;
return num_srsts;
#endif
return 0;
@@ -93,7 +100,7 @@ int rknpu_soft_reset(struct rknpu_device *rknpu_dev)
#ifndef FPGA_PLATFORM
struct iommu_domain *domain = NULL;
struct rknpu_subcore_data *subcore_data = NULL;
int ret = -EINVAL, i = 0;
int ret = 0, i = 0;
if (rknpu_dev->bypass_soft_reset) {
LOG_WARN("bypass soft reset\n");
@@ -112,17 +119,17 @@ int rknpu_soft_reset(struct rknpu_device *rknpu_dev)
wake_up(&subcore_data->job_done_wq);
}
LOG_INFO("soft reset\n");
LOG_INFO("soft reset, num: %d\n", rknpu_dev->num_srsts);
for (i = 0; i < rknpu_dev->config->num_resets; i++) {
ret = rknpu_reset_assert(rknpu_dev->srst_a[i]);
ret |= rknpu_reset_assert(rknpu_dev->srst_h[i]);
for (i = 0; i < rknpu_dev->num_srsts; ++i)
ret |= rknpu_reset_assert(rknpu_dev->srsts[i]);
udelay(10);
udelay(10);
ret |= rknpu_reset_deassert(rknpu_dev->srst_a[i]);
ret |= rknpu_reset_deassert(rknpu_dev->srst_h[i]);
}
for (i = 0; i < rknpu_dev->num_srsts; ++i)
ret |= rknpu_reset_deassert(rknpu_dev->srsts[i]);
udelay(10);
if (ret) {
LOG_DEV_ERROR(rknpu_dev->dev,