* [PATCH 10/21] v4l: fwnode: Only assign configuration if there is no error
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
Only assign endpoint configuration if the endpoint is parsed successfully.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 3f30904c158c..7c6513625f13 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -47,7 +47,7 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
enum v4l2_fwnode_bus_type bus_type)
{
struct v4l2_fwnode_bus_mipi_csi2 *bus = &vep->bus.mipi_csi2;
- bool have_clk_lane = false;
+ bool have_clk_lane = false, have_lane_polarities = false;
unsigned int flags = 0, lanes_used = 0;
u32 array[1 + V4L2_FWNODE_CSI2_MAX_DATA_LANES];
unsigned int num_data_lanes = 0;
@@ -73,7 +73,6 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
array[i]);
lanes_used |= BIT(array[i]);
- bus->data_lanes[i] = array[i];
pr_debug("lane %u position %u\n", i, array[i]);
}
}
@@ -87,16 +86,7 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
return -EINVAL;
}
- fwnode_property_read_u32_array(fwnode, "lane-polarities", array,
- 1 + num_data_lanes);
-
- for (i = 0; i < 1 + num_data_lanes; i++) {
- bus->lane_polarities[i] = array[i];
- pr_debug("lane %u polarity %sinverted",
- i, array[i] ? "" : "not ");
- }
- } else {
- pr_debug("no lane polarities defined, assuming not inverted\n");
+ have_lane_polarities = true;
}
if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v)) {
@@ -121,6 +111,22 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
bus->flags = flags;
vep->bus_type = V4L2_MBUS_CSI2_DPHY;
bus->num_data_lanes = num_data_lanes;
+ for (i = 0; i < num_data_lanes; i++)
+ bus->data_lanes[i] = array[i];
+
+ if (have_lane_polarities) {
+ fwnode_property_read_u32_array(fwnode,
+ "lane-polarities", array,
+ 1 + num_data_lanes);
+
+ for (i = 0; i < 1 + num_data_lanes; i++) {
+ bus->lane_polarities[i] = array[i];
+ pr_debug("lane %u polarity %sinverted",
+ i, array[i] ? "" : "not ");
+ }
+ } else {
+ pr_debug("no lane polarities defined, assuming not inverted\n");
+ }
}
return 0;
--
2.11.0
^ permalink raw reply related
* [PATCH 09/21] v4l: fwnode: Read lane inversion information despite lane numbering
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
Read the lane inversion independently of whether the "data-lanes" property
exists. This makes sense since the caller may pass the number of lanes as
the default configuration while the lane inversion configuration may still
be available in firmware.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 65 +++++++++++++++++++----------------
1 file changed, 35 insertions(+), 30 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index e62a1fcabd8f..3f30904c158c 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -43,26 +43,31 @@ enum v4l2_fwnode_bus_type {
};
static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
- struct v4l2_fwnode_endpoint *vep)
+ struct v4l2_fwnode_endpoint *vep,
+ enum v4l2_fwnode_bus_type bus_type)
{
struct v4l2_fwnode_bus_mipi_csi2 *bus = &vep->bus.mipi_csi2;
bool have_clk_lane = false;
unsigned int flags = 0, lanes_used = 0;
+ u32 array[1 + V4L2_FWNODE_CSI2_MAX_DATA_LANES];
+ unsigned int num_data_lanes = 0;
unsigned int i;
u32 v;
int rval;
+ if (bus_type == V4L2_FWNODE_BUS_TYPE_CSI2_DPHY)
+ num_data_lanes = min_t(u32, bus->num_data_lanes,
+ V4L2_FWNODE_CSI2_MAX_DATA_LANES);
+
rval = fwnode_property_read_u32_array(fwnode, "data-lanes", NULL, 0);
if (rval > 0) {
- u32 array[1 + V4L2_FWNODE_CSI2_MAX_DATA_LANES];
-
- bus->num_data_lanes =
+ num_data_lanes =
min_t(int, V4L2_FWNODE_CSI2_MAX_DATA_LANES, rval);
fwnode_property_read_u32_array(fwnode, "data-lanes", array,
- bus->num_data_lanes);
+ num_data_lanes);
- for (i = 0; i < bus->num_data_lanes; i++) {
+ for (i = 0; i < num_data_lanes; i++) {
if (lanes_used & BIT(array[i]))
pr_warn("duplicated lane %u in data-lanes\n",
array[i]);
@@ -71,30 +76,27 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
bus->data_lanes[i] = array[i];
pr_debug("lane %u position %u\n", i, array[i]);
}
+ }
- rval = fwnode_property_read_u32_array(fwnode,
- "lane-polarities", NULL,
- 0);
- if (rval > 0) {
- if (rval != 1 + bus->num_data_lanes /* clock+data */) {
- pr_warn("invalid number of lane-polarities entries (need %u, got %u)\n",
- 1 + bus->num_data_lanes, rval);
- return -EINVAL;
- }
+ rval = fwnode_property_read_u32_array(fwnode, "lane-polarities", NULL,
+ 0);
+ if (rval > 0) {
+ if (rval != 1 + num_data_lanes /* clock+data */) {
+ pr_warn("invalid number of lane-polarities entries (need %u, got %u)\n",
+ 1 + num_data_lanes, rval);
+ return -EINVAL;
+ }
- fwnode_property_read_u32_array(fwnode,
- "lane-polarities", array,
- 1 + bus->num_data_lanes);
+ fwnode_property_read_u32_array(fwnode, "lane-polarities", array,
+ 1 + num_data_lanes);
- for (i = 0; i < 1 + bus->num_data_lanes; i++) {
- bus->lane_polarities[i] = array[i];
- pr_debug("lane %u polarity %sinverted",
- i, array[i] ? "" : "not ");
- }
- } else {
- pr_debug("no lane polarities defined, assuming not inverted\n");
+ for (i = 0; i < 1 + num_data_lanes; i++) {
+ bus->lane_polarities[i] = array[i];
+ pr_debug("lane %u polarity %sinverted",
+ i, array[i] ? "" : "not ");
}
-
+ } else {
+ pr_debug("no lane polarities defined, assuming not inverted\n");
}
if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v)) {
@@ -114,10 +116,11 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
flags |= V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
}
- if (lanes_used || have_clk_lane ||
- (flags & ~V4L2_MBUS_CSI2_CONTINUOUS_CLOCK)) {
+ if (bus_type == V4L2_FWNODE_BUS_TYPE_CSI2_DPHY || lanes_used ||
+ have_clk_lane || (flags & ~V4L2_MBUS_CSI2_CONTINUOUS_CLOCK)) {
bus->flags = flags;
vep->bus_type = V4L2_MBUS_CSI2_DPHY;
+ bus->num_data_lanes = num_data_lanes;
}
return 0;
@@ -273,7 +276,8 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
switch (bus_type) {
case V4L2_FWNODE_BUS_TYPE_GUESS:
- rval = v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep);
+ rval = v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep,
+ bus_type);
if (rval)
return rval;
@@ -289,7 +293,8 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
return 0;
case V4L2_FWNODE_BUS_TYPE_CSI2_DPHY:
vep->bus_type = V4L2_MBUS_CSI2_DPHY;
- return v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep);
+ return v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep,
+ bus_type);
case V4L2_FWNODE_BUS_TYPE_PARALLEL:
case V4L2_FWNODE_BUS_TYPE_BT656:
v4l2_fwnode_endpoint_parse_parallel_bus(fwnode, vep, bus_type);
--
2.11.0
^ permalink raw reply related
* [PATCH 07/21] v4l: mediabus: Recognise CSI-2 D-PHY and C-PHY
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
The CSI-2 bus may use either D-PHY or C-PHY. Make this visible in media
bus enum.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/gpu/ipu-v3/ipu-csi.c | 2 +-
drivers/media/i2c/adv7180.c | 2 +-
drivers/media/i2c/ov5640.c | 4 ++--
drivers/media/i2c/ov5645.c | 2 +-
drivers/media/i2c/ov7251.c | 4 ++--
drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +-
drivers/media/i2c/s5k5baf.c | 4 ++--
drivers/media/i2c/s5k6aa.c | 2 +-
drivers/media/i2c/smiapp/smiapp-core.c | 2 +-
drivers/media/i2c/soc_camera/ov5642.c | 2 +-
drivers/media/i2c/tc358743.c | 4 ++--
drivers/media/pci/intel/ipu3/ipu3-cio2.c | 2 +-
drivers/media/platform/cadence/cdns-csi2rx.c | 2 +-
drivers/media/platform/cadence/cdns-csi2tx.c | 2 +-
drivers/media/platform/marvell-ccic/mcam-core.c | 4 ++--
drivers/media/platform/marvell-ccic/mmp-driver.c | 2 +-
drivers/media/platform/omap3isp/isp.c | 2 +-
drivers/media/platform/pxa_camera.c | 2 +-
drivers/media/platform/rcar-vin/rcar-csi2.c | 2 +-
drivers/media/platform/soc_camera/soc_mediabus.c | 2 +-
drivers/media/platform/stm32/stm32-dcmi.c | 2 +-
drivers/media/platform/ti-vpe/cal.c | 2 +-
drivers/media/v4l2-core/v4l2-fwnode.c | 2 +-
drivers/staging/media/imx/imx-media-csi.c | 2 +-
drivers/staging/media/imx/imx6-mipi-csi2.c | 2 +-
drivers/staging/media/imx074/imx074.c | 2 +-
include/media/v4l2-mediabus.h | 6 ++++--
27 files changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c
index caa05b0702e1..4bc12d7b0b49 100644
--- a/drivers/gpu/ipu-v3/ipu-csi.c
+++ b/drivers/gpu/ipu-v3/ipu-csi.c
@@ -344,7 +344,7 @@ static void fill_csi_bus_cfg(struct ipu_csi_bus_config *csicfg,
else
csicfg->clk_mode = IPU_CSI_CLK_MODE_CCIR656_PROGRESSIVE;
break;
- case V4L2_MBUS_CSI2:
+ case V4L2_MBUS_CSI2_DPHY:
/*
* MIPI CSI-2 requires non gated clock mode, all other
* parameters are not applicable for MIPI CSI-2 bus.
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 25d24a3f10a7..8241eb0c095d 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -742,7 +742,7 @@ static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
struct adv7180_state *state = to_state(sd);
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) {
- cfg->type = V4L2_MBUS_CSI2;
+ cfg->type = V4L2_MBUS_CSI2_DPHY;
cfg->flags = V4L2_MBUS_CSI2_1_LANE |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index 071f4bc240ca..942531aaae92 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -1786,7 +1786,7 @@ static int ov5640_set_power(struct ov5640_dev *sensor, bool on)
if (ret)
goto power_off;
- if (sensor->ep.bus_type == V4L2_MBUS_CSI2) {
+ if (sensor->ep.bus_type == V4L2_MBUS_CSI2_DPHY) {
/*
* start streaming briefly followed by stream off in
* order to coax the clock lane into LP-11 state.
@@ -2550,7 +2550,7 @@ static int ov5640_s_stream(struct v4l2_subdev *sd, int enable)
goto out;
}
- if (sensor->ep.bus_type == V4L2_MBUS_CSI2)
+ if (sensor->ep.bus_type == V4L2_MBUS_CSI2_DPHY)
ret = ov5640_set_stream_mipi(sensor, enable);
else
ret = ov5640_set_stream_dvp(sensor, enable);
diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index 1722cdab0daf..5eba8dd7222b 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -1127,7 +1127,7 @@ static int ov5645_probe(struct i2c_client *client,
return ret;
}
- if (ov5645->ep.bus_type != V4L2_MBUS_CSI2) {
+ if (ov5645->ep.bus_type != V4L2_MBUS_CSI2_DPHY) {
dev_err(dev, "invalid bus type, must be CSI2\n");
return -EINVAL;
}
diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index d3ebb7529fca..0c10203f822b 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -1279,9 +1279,9 @@ static int ov7251_probe(struct i2c_client *client)
return ret;
}
- if (ov7251->ep.bus_type != V4L2_MBUS_CSI2) {
+ if (ov7251->ep.bus_type != V4L2_MBUS_CSI2_DPHY) {
dev_err(dev, "invalid bus type (%u), must be CSI2 (%u)\n",
- ov7251->ep.bus_type, V4L2_MBUS_CSI2);
+ ov7251->ep.bus_type, V4L2_MBUS_CSI2_DPHY);
return -EINVAL;
}
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index ce196b60f917..9d5739cafec3 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -1644,7 +1644,7 @@ static int s5c73m3_get_platform_data(struct s5c73m3 *state)
if (ret)
return ret;
- if (ep.bus_type != V4L2_MBUS_CSI2) {
+ if (ep.bus_type != V4L2_MBUS_CSI2_DPHY) {
dev_err(dev, "unsupported bus type\n");
return -EINVAL;
}
diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
index 5007c9659342..4c41a770b132 100644
--- a/drivers/media/i2c/s5k5baf.c
+++ b/drivers/media/i2c/s5k5baf.c
@@ -766,7 +766,7 @@ static int s5k5baf_hw_set_video_bus(struct s5k5baf *state)
{
u16 en_pkts;
- if (state->bus_type == V4L2_MBUS_CSI2)
+ if (state->bus_type == V4L2_MBUS_CSI2_DPHY)
en_pkts = EN_PACKETS_CSI2;
else
en_pkts = 0;
@@ -1875,7 +1875,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev)
state->bus_type = ep.bus_type;
switch (state->bus_type) {
- case V4L2_MBUS_CSI2:
+ case V4L2_MBUS_CSI2_DPHY:
state->nlanes = ep.bus.mipi_csi2.num_data_lanes;
break;
case V4L2_MBUS_PARALLEL:
diff --git a/drivers/media/i2c/s5k6aa.c b/drivers/media/i2c/s5k6aa.c
index 13c10b5e2b45..5f097ae7a5b1 100644
--- a/drivers/media/i2c/s5k6aa.c
+++ b/drivers/media/i2c/s5k6aa.c
@@ -688,7 +688,7 @@ static int s5k6aa_configure_video_bus(struct s5k6aa *s5k6aa,
* but there is nothing indicating how to switch between both
* in the datasheet. For now default BT.601 interface is assumed.
*/
- if (bus_type == V4L2_MBUS_CSI2)
+ if (bus_type == V4L2_MBUS_CSI2_DPHY)
cfg = nlanes;
else if (bus_type != V4L2_MBUS_PARALLEL)
return -EINVAL;
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 1236683da8f7..9e33c2008ba6 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2784,7 +2784,7 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev)
goto out_err;
switch (bus_cfg->bus_type) {
- case V4L2_MBUS_CSI2:
+ case V4L2_MBUS_CSI2_DPHY:
hwcfg->csi_signalling_mode = SMIAPP_CSI_SIGNALLING_MODE_CSI2;
hwcfg->lanes = bus_cfg->bus.mipi_csi2.num_data_lanes;
break;
diff --git a/drivers/media/i2c/soc_camera/ov5642.c b/drivers/media/i2c/soc_camera/ov5642.c
index 39f420db9c70..bc045259510d 100644
--- a/drivers/media/i2c/soc_camera/ov5642.c
+++ b/drivers/media/i2c/soc_camera/ov5642.c
@@ -913,7 +913,7 @@ static int ov5642_get_selection(struct v4l2_subdev *sd,
static int ov5642_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *cfg)
{
- cfg->type = V4L2_MBUS_CSI2;
+ cfg->type = V4L2_MBUS_CSI2_DPHY;
cfg->flags = V4L2_MBUS_CSI2_2_LANE | V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 44c41933415a..6a2064597124 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1607,7 +1607,7 @@ static int tc358743_g_mbus_config(struct v4l2_subdev *sd,
{
struct tc358743_state *state = to_state(sd);
- cfg->type = V4L2_MBUS_CSI2;
+ cfg->type = V4L2_MBUS_CSI2_DPHY;
/* Support for non-continuous CSI-2 clock is missing in the driver */
cfg->flags = V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
@@ -1922,7 +1922,7 @@ static int tc358743_probe_of(struct tc358743_state *state)
goto put_node;
}
- if (endpoint->bus_type != V4L2_MBUS_CSI2 ||
+ if (endpoint->bus_type != V4L2_MBUS_CSI2_DPHY ||
endpoint->bus.mipi_csi2.num_data_lanes == 0 ||
endpoint->nr_of_link_frequencies == 0) {
dev_err(dev, "missing CSI-2 properties in endpoint\n");
diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
index 4a5f7c3360bc..f2e1942d2979 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
@@ -1484,7 +1484,7 @@ static int cio2_fwnode_parse(struct device *dev,
struct sensor_async_subdev *s_asd =
container_of(asd, struct sensor_async_subdev, asd);
- if (vep->bus_type != V4L2_MBUS_CSI2) {
+ if (vep->bus_type != V4L2_MBUS_CSI2_DPHY) {
dev_err(dev, "Only CSI2 bus type is currently supported\n");
return -EINVAL;
}
diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c
index 43e43c7b3e98..0a1fcb76cf34 100644
--- a/drivers/media/platform/cadence/cdns-csi2rx.c
+++ b/drivers/media/platform/cadence/cdns-csi2rx.c
@@ -378,7 +378,7 @@ static int csi2rx_parse_dt(struct csi2rx_priv *csi2rx)
return ret;
}
- if (v4l2_ep.bus_type != V4L2_MBUS_CSI2) {
+ if (v4l2_ep.bus_type != V4L2_MBUS_CSI2_DPHY) {
dev_err(csi2rx->dev, "Unsupported media bus type: 0x%x\n",
v4l2_ep.bus_type);
of_node_put(ep);
diff --git a/drivers/media/platform/cadence/cdns-csi2tx.c b/drivers/media/platform/cadence/cdns-csi2tx.c
index 40d0de690ff4..6224daf891d7 100644
--- a/drivers/media/platform/cadence/cdns-csi2tx.c
+++ b/drivers/media/platform/cadence/cdns-csi2tx.c
@@ -446,7 +446,7 @@ static int csi2tx_check_lanes(struct csi2tx_priv *csi2tx)
goto out;
}
- if (v4l2_ep.bus_type != V4L2_MBUS_CSI2) {
+ if (v4l2_ep.bus_type != V4L2_MBUS_CSI2_DPHY) {
dev_err(csi2tx->dev, "Unsupported media bus type: 0x%x\n",
v4l2_ep.bus_type);
ret = -EINVAL;
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
index dfdbd4354b74..5e20427aeca2 100644
--- a/drivers/media/platform/marvell-ccic/mcam-core.c
+++ b/drivers/media/platform/marvell-ccic/mcam-core.c
@@ -794,7 +794,7 @@ static void mcam_ctlr_image(struct mcam_camera *cam)
/*
* This field controls the generation of EOF(DVP only)
*/
- if (cam->bus_type != V4L2_MBUS_CSI2)
+ if (cam->bus_type != V4L2_MBUS_CSI2_DPHY)
mcam_reg_set_bit(cam, REG_CTRL0,
C0_EOF_VSYNC | C0_VEDGE_CTRL);
}
@@ -1023,7 +1023,7 @@ static int mcam_read_setup(struct mcam_camera *cam)
cam->calc_dphy(cam);
cam_dbg(cam, "camera: DPHY sets: dphy3=0x%x, dphy5=0x%x, dphy6=0x%x\n",
cam->dphy[0], cam->dphy[1], cam->dphy[2]);
- if (cam->bus_type == V4L2_MBUS_CSI2)
+ if (cam->bus_type == V4L2_MBUS_CSI2_DPHY)
mcam_enable_mipi(cam);
else
mcam_disable_mipi(cam);
diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
index 6d9f0abb2660..25ce31b71a45 100644
--- a/drivers/media/platform/marvell-ccic/mmp-driver.c
+++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
@@ -362,7 +362,7 @@ static int mmpcam_probe(struct platform_device *pdev)
mcam->mclk_div = pdata->mclk_div;
mcam->bus_type = pdata->bus_type;
mcam->dphy = pdata->dphy;
- if (mcam->bus_type == V4L2_MBUS_CSI2) {
+ if (mcam->bus_type == V4L2_MBUS_CSI2_DPHY) {
cam->mipi_clk = devm_clk_get(mcam->dev, "mipi");
if ((IS_ERR(cam->mipi_clk) && mcam->dphy[2] == 0))
return PTR_ERR(cam->mipi_clk);
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 1211bfe9cda1..a7fde7fc00b2 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2054,7 +2054,7 @@ static int isp_fwnode_parse(struct device *dev,
dev_dbg(dev, "CSI-1/CCP-2 configuration\n");
csi1 = true;
break;
- case V4L2_MBUS_CSI2:
+ case V4L2_MBUS_CSI2_DPHY:
dev_dbg(dev, "CSI-2 configuration\n");
csi1 = false;
break;
diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
index d85ffbfb7c1f..bbb7a77eeb78 100644
--- a/drivers/media/platform/pxa_camera.c
+++ b/drivers/media/platform/pxa_camera.c
@@ -633,7 +633,7 @@ static unsigned int pxa_mbus_config_compatible(const struct v4l2_mbus_config *cf
mode = common_flags & (V4L2_MBUS_MASTER | V4L2_MBUS_SLAVE);
return (!hsync || !vsync || !pclk || !data || !mode) ?
0 : common_flags;
- case V4L2_MBUS_CSI2:
+ case V4L2_MBUS_CSI2_DPHY:
mipi_lanes = common_flags & V4L2_MBUS_CSI2_LANES;
mipi_clock = common_flags & (V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK);
diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
index daef72d410a3..45aa10d23dc3 100644
--- a/drivers/media/platform/rcar-vin/rcar-csi2.c
+++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
@@ -706,7 +706,7 @@ static int rcsi2_parse_v4l2(struct rcar_csi2 *priv,
if (vep->base.port || vep->base.id)
return -ENOTCONN;
- if (vep->bus_type != V4L2_MBUS_CSI2) {
+ if (vep->bus_type != V4L2_MBUS_CSI2_DPHY) {
dev_err(priv->dev, "Unsupported bus: %u\n", vep->bus_type);
return -EINVAL;
}
diff --git a/drivers/media/platform/soc_camera/soc_mediabus.c b/drivers/media/platform/soc_camera/soc_mediabus.c
index 0ad4b28266e4..be74008ec0ca 100644
--- a/drivers/media/platform/soc_camera/soc_mediabus.c
+++ b/drivers/media/platform/soc_camera/soc_mediabus.c
@@ -503,7 +503,7 @@ unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
mode = common_flags & (V4L2_MBUS_MASTER | V4L2_MBUS_SLAVE);
return (!hsync || !vsync || !pclk || !data || !mode) ?
0 : common_flags;
- case V4L2_MBUS_CSI2:
+ case V4L2_MBUS_CSI2_DPHY:
mipi_lanes = common_flags & V4L2_MBUS_CSI2_LANES;
mipi_clock = common_flags & (V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK);
diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index 721564176d8c..56a331392769 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -1663,7 +1663,7 @@ static int dcmi_probe(struct platform_device *pdev)
return -ENODEV;
}
- if (ep.bus_type == V4L2_MBUS_CSI2) {
+ if (ep.bus_type == V4L2_MBUS_CSI2_DPHY) {
dev_err(&pdev->dev, "CSI bus not supported\n");
return -ENODEV;
}
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index d1febe5baa6d..887af872b0fd 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -1711,7 +1711,7 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
}
v4l2_fwnode_endpoint_parse(of_fwnode_handle(remote_ep), endpoint);
- if (endpoint->bus_type != V4L2_MBUS_CSI2) {
+ if (endpoint->bus_type != V4L2_MBUS_CSI2_DPHY) {
ctx_err(ctx, "Port:%d sub-device %s is not a CSI2 device\n",
inst, sensor_node->name);
goto cleanup_exit;
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 4c98d17ab124..85f409808042 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -117,7 +117,7 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
if (lanes_used || have_clk_lane ||
(flags & ~V4L2_MBUS_CSI2_CONTINUOUS_CLOCK)) {
bus->flags = flags;
- vep->bus_type = V4L2_MBUS_CSI2;
+ vep->bus_type = V4L2_MBUS_CSI2_DPHY;
}
return 0;
diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index 19ef3771b7b1..7f5932618ab1 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -124,7 +124,7 @@ static inline struct csi_priv *sd_to_dev(struct v4l2_subdev *sdev)
static inline bool is_parallel_bus(struct v4l2_fwnode_endpoint *ep)
{
- return ep->bus_type != V4L2_MBUS_CSI2;
+ return ep->bus_type != V4L2_MBUS_CSI2_DPHY;
}
static inline bool is_parallel_16bit_bus(struct v4l2_fwnode_endpoint *ep)
diff --git a/drivers/staging/media/imx/imx6-mipi-csi2.c b/drivers/staging/media/imx/imx6-mipi-csi2.c
index 94eb9a1f38bb..74438a4c1267 100644
--- a/drivers/staging/media/imx/imx6-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx6-mipi-csi2.c
@@ -563,7 +563,7 @@ static int csi2_parse_endpoint(struct device *dev,
return -EINVAL;
}
- if (vep->bus_type != V4L2_MBUS_CSI2) {
+ if (vep->bus_type != V4L2_MBUS_CSI2_DPHY) {
v4l2_err(&csi2->sd, "invalid bus type, must be MIPI CSI2\n");
return -EINVAL;
}
diff --git a/drivers/staging/media/imx074/imx074.c b/drivers/staging/media/imx074/imx074.c
index 77f1e0243d6e..0eee9f0def4d 100644
--- a/drivers/staging/media/imx074/imx074.c
+++ b/drivers/staging/media/imx074/imx074.c
@@ -263,7 +263,7 @@ static int imx074_s_power(struct v4l2_subdev *sd, int on)
static int imx074_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *cfg)
{
- cfg->type = V4L2_MBUS_CSI2;
+ cfg->type = V4L2_MBUS_CSI2_DPHY;
cfg->flags = V4L2_MBUS_CSI2_2_LANE |
V4L2_MBUS_CSI2_CHANNEL_0 |
V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 66d74c813f53..df1d552e9df6 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -76,7 +76,8 @@
* also be used for BT.1120
* @V4L2_MBUS_CSI1: MIPI CSI-1 serial interface
* @V4L2_MBUS_CCP2: CCP2 (Compact Camera Port 2)
- * @V4L2_MBUS_CSI2: MIPI CSI-2 serial interface
+ * @V4L2_MBUS_CSI2_DPHY: MIPI CSI-2 serial interface, with D-PHY
+ * @V4L2_MBUS_CSI2_CPHY: MIPI CSI-2 serial interface, with C-PHY
*/
enum v4l2_mbus_type {
V4L2_MBUS_UNKNOWN,
@@ -84,7 +85,8 @@ enum v4l2_mbus_type {
V4L2_MBUS_BT656,
V4L2_MBUS_CSI1,
V4L2_MBUS_CCP2,
- V4L2_MBUS_CSI2,
+ V4L2_MBUS_CSI2_DPHY,
+ V4L2_MBUS_CSI2_CPHY,
};
/**
--
2.11.0
^ permalink raw reply related
* [PATCH 08/21] v4l: fwnode: Make use of newly specified bus types
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
Make use of bus type specified for an endpoint.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 48 ++++++++++++++++++++++++++---------
1 file changed, 36 insertions(+), 12 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 85f409808042..e62a1fcabd8f 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -123,8 +123,16 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
return 0;
}
+#define PARALLEL_MBUS_FLAGS (V4L2_MBUS_HSYNC_ACTIVE_HIGH | \
+ V4L2_MBUS_HSYNC_ACTIVE_LOW | \
+ V4L2_MBUS_VSYNC_ACTIVE_HIGH | \
+ V4L2_MBUS_VSYNC_ACTIVE_LOW | \
+ V4L2_MBUS_FIELD_EVEN_HIGH | \
+ V4L2_MBUS_FIELD_EVEN_LOW)
+
static void v4l2_fwnode_endpoint_parse_parallel_bus(
- struct fwnode_handle *fwnode, struct v4l2_fwnode_endpoint *vep)
+ struct fwnode_handle *fwnode, struct v4l2_fwnode_endpoint *vep,
+ enum v4l2_fwnode_bus_type bus_type)
{
struct v4l2_fwnode_bus_parallel *bus = &vep->bus.parallel;
unsigned int flags = 0;
@@ -192,17 +200,24 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus(
pr_debug("data-enable-active %s\n", v ? "high" : "low");
}
- if (flags || is_parallel) {
+ switch (bus_type) {
+ default:
bus->flags = flags;
- if (flags & (V4L2_MBUS_HSYNC_ACTIVE_HIGH |
- V4L2_MBUS_HSYNC_ACTIVE_LOW |
- V4L2_MBUS_VSYNC_ACTIVE_HIGH |
- V4L2_MBUS_VSYNC_ACTIVE_LOW |
- V4L2_MBUS_FIELD_EVEN_HIGH |
- V4L2_MBUS_FIELD_EVEN_LOW))
- vep->bus_type = V4L2_MBUS_PARALLEL;
- else
- vep->bus_type = V4L2_MBUS_BT656;
+ if (flags || is_parallel) {
+ if (flags & PARALLEL_MBUS_FLAGS)
+ vep->bus_type = V4L2_MBUS_PARALLEL;
+ else
+ vep->bus_type = V4L2_MBUS_BT656;
+ }
+ break;
+ case V4L2_FWNODE_BUS_TYPE_PARALLEL:
+ vep->bus_type = V4L2_MBUS_PARALLEL;
+ bus->flags = flags;
+ break;
+ case V4L2_FWNODE_BUS_TYPE_BT656:
+ vep->bus_type = V4L2_MBUS_BT656;
+ bus->flags = flags & ~PARALLEL_MBUS_FLAGS;
+ break;
}
}
@@ -263,7 +278,8 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
return rval;
if (vep->bus_type == V4L2_MBUS_UNKNOWN)
- v4l2_fwnode_endpoint_parse_parallel_bus(fwnode, vep);
+ v4l2_fwnode_endpoint_parse_parallel_bus(
+ fwnode, vep, V4L2_MBUS_UNKNOWN);
return vep->bus_type == V4L2_MBUS_UNKNOWN ? -EINVAL : 0;
case V4L2_FWNODE_BUS_TYPE_CCP2:
@@ -271,6 +287,14 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
v4l2_fwnode_endpoint_parse_csi1_bus(fwnode, vep, bus_type);
return 0;
+ case V4L2_FWNODE_BUS_TYPE_CSI2_DPHY:
+ vep->bus_type = V4L2_MBUS_CSI2_DPHY;
+ return v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep);
+ case V4L2_FWNODE_BUS_TYPE_PARALLEL:
+ case V4L2_FWNODE_BUS_TYPE_BT656:
+ v4l2_fwnode_endpoint_parse_parallel_bus(fwnode, vep, bus_type);
+
+ return 0;
default:
pr_warn("unsupported bus type %u\n", bus_type);
return -EINVAL;
--
2.11.0
^ permalink raw reply related
* [PATCH 11/21] v4l: fwnode: Support driver-defined lane mapping defaults
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
Make use of the default CSI-2 lane mapping from caller-passed
configuration.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 7c6513625f13..ed147b6fd315 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -55,10 +55,14 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
u32 v;
int rval;
- if (bus_type == V4L2_FWNODE_BUS_TYPE_CSI2_DPHY)
+ if (bus_type == V4L2_FWNODE_BUS_TYPE_CSI2_DPHY) {
num_data_lanes = min_t(u32, bus->num_data_lanes,
V4L2_FWNODE_CSI2_MAX_DATA_LANES);
+ for (i = 0; i < num_data_lanes; i++)
+ array[i] = bus->data_lanes[i];
+ }
+
rval = fwnode_property_read_u32_array(fwnode, "data-lanes", NULL, 0);
if (rval > 0) {
num_data_lanes =
@@ -66,15 +70,15 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
fwnode_property_read_u32_array(fwnode, "data-lanes", array,
num_data_lanes);
+ }
- for (i = 0; i < num_data_lanes; i++) {
- if (lanes_used & BIT(array[i]))
- pr_warn("duplicated lane %u in data-lanes\n",
- array[i]);
- lanes_used |= BIT(array[i]);
+ for (i = 0; i < num_data_lanes; i++) {
+ if (lanes_used & BIT(array[i]))
+ pr_warn("duplicated lane %u in data-lanes\n",
+ array[i]);
+ lanes_used |= BIT(array[i]);
- pr_debug("lane %u position %u\n", i, array[i]);
- }
+ pr_debug("lane %u position %u\n", i, array[i]);
}
rval = fwnode_property_read_u32_array(fwnode, "lane-polarities", NULL,
--
2.11.0
^ permalink raw reply related
* [PATCH 06/21] v4l: fwnode: Add definitions for CSI-2 D-PHY, parallel and Bt.656 busses
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
Add definitions corresponding to DT bindings to the CSI-2 D-PHY, parallel
and Bt.656 busses.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 291b3dcc19f3..4c98d17ab124 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -36,6 +36,9 @@ enum v4l2_fwnode_bus_type {
V4L2_FWNODE_BUS_TYPE_CSI2_CPHY,
V4L2_FWNODE_BUS_TYPE_CSI1,
V4L2_FWNODE_BUS_TYPE_CCP2,
+ V4L2_FWNODE_BUS_TYPE_CSI2_DPHY,
+ V4L2_FWNODE_BUS_TYPE_PARALLEL,
+ V4L2_FWNODE_BUS_TYPE_BT656,
NR_OF_V4L2_FWNODE_BUS_TYPE,
};
--
2.11.0
^ permalink raw reply related
* [PATCH 05/21] dt-bindings: media: Specify bus type for MIPI D-PHY, others, explicitly
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
Allow specifying the bus type explicitly for MIPI D-PHY, parallel and
Bt.656 busses. This is useful for devices that can make use of different
bus types. There are CSI-2 transmitters and receivers but the PHY
selection needs to be made between C-PHY and D-PHY; many devices also
support parallel and Bt.656 interfaces but the means to pass that
information to software wasn't there.
Autodetection (value 0) is removed as an option as the property could be
simply omitted in that case.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Documentation/devicetree/bindings/media/video-interfaces.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt b/Documentation/devicetree/bindings/media/video-interfaces.txt
index baf9d9756b3c..f884ada0bffc 100644
--- a/Documentation/devicetree/bindings/media/video-interfaces.txt
+++ b/Documentation/devicetree/bindings/media/video-interfaces.txt
@@ -100,10 +100,12 @@ Optional endpoint properties
slave device (data source) by the master device (data sink). In the master
mode the data source device is also the source of the synchronization signals.
- bus-type: data bus type. Possible values are:
- 0 - autodetect based on other properties (MIPI CSI-2 D-PHY, parallel or Bt656)
1 - MIPI CSI-2 C-PHY
2 - MIPI CSI1
3 - CCP2
+ 4 - MIPI CSI-2 D-PHY
+ 5 - Parallel
+ 6 - Bt.656
- bus-width: number of data lines actively used, valid for the parallel busses.
- data-shift: on the parallel data busses, if bus-width is used to specify the
number of data lines, data-shift can be used to specify which data lines are
--
2.11.0
^ permalink raw reply related
* [PATCH 00/21] V4L2 fwnode rework; support for default configuration
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
Hello everyone,
I've long thought the V4L2 fwnode framework requires some work (it's buggy
and it does not adequately serve common needs). This set should address in
particular these matters:
- Most devices support a particular media bus type but the V4L2 fwnode
framework was not able to use such information, but instead tried to
guess the bus type with varying levels of success while drivers
generally ignored the results. This patchset makes that possible ---
setting a bus type enables parsing configuration for only that bus.
Failing that check results in returning -ENXIO to be returned.
- Support specifying default configuration. If the endpoint has no
configuration, the defaults set by the driver (as documented in DT
bindings) will prevail. Any available configuration will still be read
from the endpoint as one could expect. A common use case for this is
e.g. the number of CSI-2 lanes. Few devices support lane mapping, and
default 1:1 mapping is provided in absence of a valid default or
configuration read OF.
- Debugging information is greatly improved.
- Recognition of the differences between CSI-2 D-PHY and C-PHY. All
currently supported hardware (or at least drivers) is D-PHY only, so
this change is still easy.
The smiapp driver is converted to use the new functionality. This patchset
does not address remaining issues such as supporting setting defaults for
e.g. bridge drivers with multiple ports, but with Steve Longerbeam's
patchset we're much closer with that goal. I've rebased this set on top of
Steve's. Albeit the two deal with the same files, there were only a few
trivial conflicts.
Note that I've only tested parsing endpoints for the CSI-2 bus (no
parallel IF hardware). Testing in general would be beneficial: the code
flows are rather convoluted and different hardware tends to excercise
different flows while the use of the use of defaults has a similar
effect.
Comments are welcome.
I've pushed the patches (including Steve's) here:
<URL:https://git.linuxtv.org/sailus/media_tree.git/log/?h=v4l2-fwnode>
Sakari Ailus (21):
v4l: fwnode: Add debug prints for V4L2 endpoint property parsing
v4l: fwnode: Use fwnode_graph_for_each_endpoint
v4l: fwnode: Detect bus type correctly
v4l: fwnode: The CSI-2 clock is continuous if it's not non-continuous
dt-bindings: media: Specify bus type for MIPI D-PHY, others,
explicitly
v4l: fwnode: Add definitions for CSI-2 D-PHY, parallel and Bt.656
busses
v4l: mediabus: Recognise CSI-2 D-PHY and C-PHY
v4l: fwnode: Make use of newly specified bus types
v4l: fwnode: Read lane inversion information despite lane numbering
v4l: fwnode: Only assign configuration if there is no error
v4l: fwnode: Support driver-defined lane mapping defaults
v4l: fwnode: Support default CSI-2 lane mapping for drivers
v4l: fwnode: Parse the graph endpoint as last
v4l: fwnode: Use default parallel flags
v4l: fwnode: Allow setting default parameters
v4l: fwnode: Use media bus type for bus parser selection
v4l: fwnode: Print bus type
v4l: fwnode: Use V4L2 fwnode endpoint media bus type if set
v4l: fwnode: Support parsing of CSI-2 C-PHY endpoints
v4l: fwnode: Update V4L2 fwnode endpoint parsing documentation
smiapp: Query the V4L2 endpoint for a specific bus type
.../devicetree/bindings/media/video-interfaces.txt | 4 +-
drivers/gpu/ipu-v3/ipu-csi.c | 2 +-
drivers/media/i2c/adv7180.c | 2 +-
drivers/media/i2c/ov2659.c | 14 +-
drivers/media/i2c/ov5640.c | 4 +-
drivers/media/i2c/ov5645.c | 2 +-
drivers/media/i2c/ov7251.c | 4 +-
drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +-
drivers/media/i2c/s5k5baf.c | 4 +-
drivers/media/i2c/s5k6aa.c | 2 +-
drivers/media/i2c/smiapp/smiapp-core.c | 34 +-
drivers/media/i2c/soc_camera/ov5642.c | 2 +-
drivers/media/i2c/tc358743.c | 28 +-
drivers/media/pci/intel/ipu3/ipu3-cio2.c | 2 +-
drivers/media/platform/cadence/cdns-csi2rx.c | 2 +-
drivers/media/platform/cadence/cdns-csi2tx.c | 2 +-
drivers/media/platform/marvell-ccic/mcam-core.c | 4 +-
drivers/media/platform/marvell-ccic/mmp-driver.c | 2 +-
drivers/media/platform/omap3isp/isp.c | 2 +-
drivers/media/platform/pxa_camera.c | 2 +-
drivers/media/platform/rcar-vin/rcar-csi2.c | 2 +-
drivers/media/platform/soc_camera/soc_mediabus.c | 2 +-
drivers/media/platform/stm32/stm32-dcmi.c | 2 +-
drivers/media/platform/ti-vpe/cal.c | 2 +-
drivers/media/v4l2-core/v4l2-fwnode.c | 510 ++++++++++++++++-----
drivers/staging/media/imx/imx-media-csi.c | 2 +-
drivers/staging/media/imx/imx6-mipi-csi2.c | 2 +-
drivers/staging/media/imx074/imx074.c | 2 +-
include/media/v4l2-fwnode.h | 33 +-
include/media/v4l2-mediabus.h | 8 +-
30 files changed, 505 insertions(+), 180 deletions(-)
--
2.11.0
^ permalink raw reply
* [PATCH 03/21] v4l: fwnode: Detect bus type correctly
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
In case the device supports multiple video bus types on an endpoint, the
V4L2 fwnode framework attempts to detect the type based on the available
information. This wasn't working really well, and sometimes could lead to
the V4L2 fwnode endpoint struct as being mishandled between the bus types.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 43 +++++++++++++++++++----------------
include/media/v4l2-mediabus.h | 2 ++
2 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index da13348b1f4a..55214ff5a616 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -111,8 +111,10 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
flags |= V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
}
- bus->flags = flags;
- vep->bus_type = V4L2_MBUS_CSI2;
+ if (lanes_used || have_clk_lane || flags) {
+ bus->flags = flags;
+ vep->bus_type = V4L2_MBUS_CSI2;
+ }
return 0;
}
@@ -122,6 +124,7 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus(
{
struct v4l2_fwnode_bus_parallel *bus = &vep->bus.parallel;
unsigned int flags = 0;
+ bool is_parallel = false;
u32 v;
if (!fwnode_property_read_u32(fwnode, "hsync-active", &v)) {
@@ -142,11 +145,6 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus(
pr_debug("field-even-active %s\n", v ? "high" : "low");
}
- if (flags)
- vep->bus_type = V4L2_MBUS_PARALLEL;
- else
- vep->bus_type = V4L2_MBUS_BT656;
-
if (!fwnode_property_read_u32(fwnode, "pclk-sample", &v)) {
flags |= v ? V4L2_MBUS_PCLK_SAMPLE_RISING :
V4L2_MBUS_PCLK_SAMPLE_FALLING;
@@ -168,11 +166,13 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus(
if (!fwnode_property_read_u32(fwnode, "bus-width", &v)) {
bus->bus_width = v;
+ is_parallel = true;
pr_debug("bus-width %u\n", v);
}
if (!fwnode_property_read_u32(fwnode, "data-shift", &v)) {
bus->data_shift = v;
+ is_parallel = true;
pr_debug("data-shift %u\n", v);
}
@@ -188,14 +188,24 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus(
pr_debug("data-enable-active %s\n", v ? "high" : "low");
}
- bus->flags = flags;
-
+ if (flags || is_parallel) {
+ bus->flags = flags;
+ if (flags & (V4L2_MBUS_HSYNC_ACTIVE_HIGH |
+ V4L2_MBUS_HSYNC_ACTIVE_LOW |
+ V4L2_MBUS_VSYNC_ACTIVE_HIGH |
+ V4L2_MBUS_VSYNC_ACTIVE_LOW |
+ V4L2_MBUS_FIELD_EVEN_HIGH |
+ V4L2_MBUS_FIELD_EVEN_LOW))
+ vep->bus_type = V4L2_MBUS_PARALLEL;
+ else
+ vep->bus_type = V4L2_MBUS_BT656;
+ }
}
static void
v4l2_fwnode_endpoint_parse_csi1_bus(struct fwnode_handle *fwnode,
struct v4l2_fwnode_endpoint *vep,
- u32 bus_type)
+ enum v4l2_fwnode_bus_type bus_type)
{
struct v4l2_fwnode_bus_mipi_csi1 *bus = &vep->bus.mipi_csi1;
u32 v;
@@ -247,25 +257,20 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
rval = v4l2_fwnode_endpoint_parse_csi2_bus(fwnode, vep);
if (rval)
return rval;
- /*
- * Parse the parallel video bus properties only if none
- * of the MIPI CSI-2 specific properties were found.
- */
- if (vep->bus.mipi_csi2.flags == 0)
+
+ if (vep->bus_type == V4L2_MBUS_UNKNOWN)
v4l2_fwnode_endpoint_parse_parallel_bus(fwnode, vep);
- break;
+ return vep->bus_type == V4L2_MBUS_UNKNOWN ? -EINVAL : 0;
case V4L2_FWNODE_BUS_TYPE_CCP2:
case V4L2_FWNODE_BUS_TYPE_CSI1:
v4l2_fwnode_endpoint_parse_csi1_bus(fwnode, vep, bus_type);
- break;
+ return 0;
default:
pr_warn("unsupported bus type %u\n", bus_type);
return -EINVAL;
}
-
- return 0;
}
int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 4bbb5f3d2b02..66d74c813f53 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -70,6 +70,7 @@
/**
* enum v4l2_mbus_type - media bus type
+ * @V4L2_MBUS_UNKNOWN: unknown bus type, no V4L2 mediabus configuration
* @V4L2_MBUS_PARALLEL: parallel interface with hsync and vsync
* @V4L2_MBUS_BT656: parallel interface with embedded synchronisation, can
* also be used for BT.1120
@@ -78,6 +79,7 @@
* @V4L2_MBUS_CSI2: MIPI CSI-2 serial interface
*/
enum v4l2_mbus_type {
+ V4L2_MBUS_UNKNOWN,
V4L2_MBUS_PARALLEL,
V4L2_MBUS_BT656,
V4L2_MBUS_CSI1,
--
2.11.0
^ permalink raw reply related
* [PATCH 02/21] v4l: fwnode: Use fwnode_graph_for_each_endpoint
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
Use fwnode_graph_for_each_endpoint iterator for better readability.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index dae01d5f570e..da13348b1f4a 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -456,8 +456,7 @@ static int __v4l2_async_notifier_parse_fwnode_endpoints(
if (WARN_ON(asd_struct_size < sizeof(struct v4l2_async_subdev)))
return -EINVAL;
- for (fwnode = NULL; (fwnode = fwnode_graph_get_next_endpoint(
- dev_fwnode(dev), fwnode)); ) {
+ fwnode_graph_for_each_endpoint(dev_fwnode(dev), fwnode) {
struct fwnode_handle *dev_fwnode;
bool is_available;
--
2.11.0
^ permalink raw reply related
* [PATCH 01/21] v4l: fwnode: Add debug prints for V4L2 endpoint property parsing
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
Print debug info as standard V4L2 endpoint are parsed.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 108 ++++++++++++++++++++++++++--------
1 file changed, 85 insertions(+), 23 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 5a65ca19ba05..dae01d5f570e 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -66,6 +66,7 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
lanes_used |= BIT(array[i]);
bus->data_lanes[i] = array[i];
+ pr_debug("lane %u position %u\n", i, array[i]);
}
rval = fwnode_property_read_u32_array(fwnode,
@@ -82,8 +83,13 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
"lane-polarities", array,
1 + bus->num_data_lanes);
- for (i = 0; i < 1 + bus->num_data_lanes; i++)
+ for (i = 0; i < 1 + bus->num_data_lanes; i++) {
bus->lane_polarities[i] = array[i];
+ pr_debug("lane %u polarity %sinverted",
+ i, array[i] ? "" : "not ");
+ }
+ } else {
+ pr_debug("no lane polarities defined, assuming not inverted\n");
}
}
@@ -95,12 +101,15 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
bus->clock_lane = v;
have_clk_lane = true;
+ pr_debug("clock lane position %u\n", v);
}
- if (fwnode_property_present(fwnode, "clock-noncontinuous"))
+ if (fwnode_property_present(fwnode, "clock-noncontinuous")) {
flags |= V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;
- else if (have_clk_lane || bus->num_data_lanes > 0)
+ pr_debug("non-continuous clock\n");
+ } else if (have_clk_lane || bus->num_data_lanes > 0) {
flags |= V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
+ }
bus->flags = flags;
vep->bus_type = V4L2_MBUS_CSI2;
@@ -115,48 +124,69 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus(
unsigned int flags = 0;
u32 v;
- if (!fwnode_property_read_u32(fwnode, "hsync-active", &v))
+ if (!fwnode_property_read_u32(fwnode, "hsync-active", &v)) {
flags |= v ? V4L2_MBUS_HSYNC_ACTIVE_HIGH :
V4L2_MBUS_HSYNC_ACTIVE_LOW;
+ pr_debug("hsync-active %s\n", v ? "high" : "low");
+ }
- if (!fwnode_property_read_u32(fwnode, "vsync-active", &v))
+ if (!fwnode_property_read_u32(fwnode, "vsync-active", &v)) {
flags |= v ? V4L2_MBUS_VSYNC_ACTIVE_HIGH :
V4L2_MBUS_VSYNC_ACTIVE_LOW;
+ pr_debug("vsync-active %s\n", v ? "high" : "low");
+ }
- if (!fwnode_property_read_u32(fwnode, "field-even-active", &v))
+ if (!fwnode_property_read_u32(fwnode, "field-even-active", &v)) {
flags |= v ? V4L2_MBUS_FIELD_EVEN_HIGH :
V4L2_MBUS_FIELD_EVEN_LOW;
+ pr_debug("field-even-active %s\n", v ? "high" : "low");
+ }
+
if (flags)
vep->bus_type = V4L2_MBUS_PARALLEL;
else
vep->bus_type = V4L2_MBUS_BT656;
- if (!fwnode_property_read_u32(fwnode, "pclk-sample", &v))
+ if (!fwnode_property_read_u32(fwnode, "pclk-sample", &v)) {
flags |= v ? V4L2_MBUS_PCLK_SAMPLE_RISING :
V4L2_MBUS_PCLK_SAMPLE_FALLING;
+ pr_debug("pclk-sample %s\n", v ? "high" : "low");
+ }
- if (!fwnode_property_read_u32(fwnode, "data-active", &v))
+ if (!fwnode_property_read_u32(fwnode, "data-active", &v)) {
flags |= v ? V4L2_MBUS_DATA_ACTIVE_HIGH :
V4L2_MBUS_DATA_ACTIVE_LOW;
+ pr_debug("data-active %s\n", v ? "high" : "low");
+ }
- if (fwnode_property_present(fwnode, "slave-mode"))
+ if (fwnode_property_present(fwnode, "slave-mode")) {
+ pr_debug("slave mode\n");
flags |= V4L2_MBUS_SLAVE;
- else
+ } else {
flags |= V4L2_MBUS_MASTER;
+ }
- if (!fwnode_property_read_u32(fwnode, "bus-width", &v))
+ if (!fwnode_property_read_u32(fwnode, "bus-width", &v)) {
bus->bus_width = v;
+ pr_debug("bus-width %u\n", v);
+ }
- if (!fwnode_property_read_u32(fwnode, "data-shift", &v))
+ if (!fwnode_property_read_u32(fwnode, "data-shift", &v)) {
bus->data_shift = v;
+ pr_debug("data-shift %u\n", v);
+ }
- if (!fwnode_property_read_u32(fwnode, "sync-on-green-active", &v))
+ if (!fwnode_property_read_u32(fwnode, "sync-on-green-active", &v)) {
flags |= v ? V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH :
V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW;
+ pr_debug("sync-on-green-active %s\n", v ? "high" : "low");
+ }
- if (!fwnode_property_read_u32(fwnode, "data-enable-active", &v))
+ if (!fwnode_property_read_u32(fwnode, "data-enable-active", &v)) {
flags |= v ? V4L2_MBUS_DATA_ENABLE_HIGH :
V4L2_MBUS_DATA_ENABLE_LOW;
+ pr_debug("data-enable-active %s\n", v ? "high" : "low");
+ }
bus->flags = flags;
@@ -170,17 +200,25 @@ v4l2_fwnode_endpoint_parse_csi1_bus(struct fwnode_handle *fwnode,
struct v4l2_fwnode_bus_mipi_csi1 *bus = &vep->bus.mipi_csi1;
u32 v;
- if (!fwnode_property_read_u32(fwnode, "clock-inv", &v))
+ if (!fwnode_property_read_u32(fwnode, "clock-inv", &v)) {
bus->clock_inv = v;
+ pr_debug("clock-inv %u\n", v);
+ }
- if (!fwnode_property_read_u32(fwnode, "strobe", &v))
+ if (!fwnode_property_read_u32(fwnode, "strobe", &v)) {
bus->strobe = v;
+ pr_debug("strobe %u\n", v);
+ }
- if (!fwnode_property_read_u32(fwnode, "data-lanes", &v))
+ if (!fwnode_property_read_u32(fwnode, "data-lanes", &v)) {
bus->data_lane = v;
+ pr_debug("data-lanes %u\n", v);
+ }
- if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v))
+ if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v)) {
bus->clock_lane = v;
+ pr_debug("clock-lanes %u\n", v);
+ }
if (bus_type == V4L2_FWNODE_BUS_TYPE_CCP2)
vep->bus_type = V4L2_MBUS_CCP2;
@@ -188,12 +226,14 @@ v4l2_fwnode_endpoint_parse_csi1_bus(struct fwnode_handle *fwnode,
vep->bus_type = V4L2_MBUS_CSI1;
}
-int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
- struct v4l2_fwnode_endpoint *vep)
+static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
+ struct v4l2_fwnode_endpoint *vep)
{
u32 bus_type = 0;
int rval;
+ pr_debug("===== begin V4L2 endpoint properties\n");
+
fwnode_graph_parse_endpoint(fwnode, &vep->base);
/* Zero fields from bus_type to until the end */
@@ -214,16 +254,30 @@ int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
if (vep->bus.mipi_csi2.flags == 0)
v4l2_fwnode_endpoint_parse_parallel_bus(fwnode, vep);
- return 0;
+ break;
case V4L2_FWNODE_BUS_TYPE_CCP2:
case V4L2_FWNODE_BUS_TYPE_CSI1:
v4l2_fwnode_endpoint_parse_csi1_bus(fwnode, vep, bus_type);
- return 0;
+ break;
default:
pr_warn("unsupported bus type %u\n", bus_type);
return -EINVAL;
}
+
+ return 0;
+}
+
+int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
+ struct v4l2_fwnode_endpoint *vep)
+{
+ int ret;
+
+ ret = __v4l2_fwnode_endpoint_parse(fwnode, vep);
+
+ pr_debug("===== end V4L2 endpoint properties\n");
+
+ return ret;
}
EXPORT_SYMBOL_GPL(v4l2_fwnode_endpoint_parse);
@@ -247,13 +301,15 @@ struct v4l2_fwnode_endpoint *v4l2_fwnode_endpoint_alloc_parse(
if (!vep)
return ERR_PTR(-ENOMEM);
- rval = v4l2_fwnode_endpoint_parse(fwnode, vep);
+ rval = __v4l2_fwnode_endpoint_parse(fwnode, vep);
if (rval < 0)
goto out_err;
rval = fwnode_property_read_u64_array(fwnode, "link-frequencies",
NULL, 0);
if (rval > 0) {
+ unsigned int i;
+
vep->link_frequencies =
kmalloc_array(rval, sizeof(*vep->link_frequencies),
GFP_KERNEL);
@@ -269,8 +325,14 @@ struct v4l2_fwnode_endpoint *v4l2_fwnode_endpoint_alloc_parse(
vep->nr_of_link_frequencies);
if (rval < 0)
goto out_err;
+
+ for (i = 0; i < vep->nr_of_link_frequencies; i++)
+ pr_info("link-frequencies %u value %llu\n", i,
+ vep->link_frequencies[i]);
}
+ pr_debug("===== end V4L2 endpoint properties\n");
+
return vep;
out_err:
--
2.11.0
^ permalink raw reply related
* [PATCH 04/21] v4l: fwnode: The CSI-2 clock is continuous if it's not non-continuous
From: Sakari Ailus @ 2018-07-23 13:46 UTC (permalink / raw)
To: linux-media; +Cc: devicetree, slongerbeam, niklas.soderlund
In-Reply-To: <20180723134706.15334-1-sakari.ailus@linux.intel.com>
The continuous clock flag was only set if there was a clock or data lanes.
This isn't needed as such a configuration is invalid to begin with. Always
set the continuous clock flag if the non-continuous property is not found.
Still don't consider the continuous clock flag as an indication that this
is CSI-2 as it's set in the absence of the property.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-fwnode.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index 55214ff5a616..291b3dcc19f3 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -107,11 +107,12 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
if (fwnode_property_present(fwnode, "clock-noncontinuous")) {
flags |= V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;
pr_debug("non-continuous clock\n");
- } else if (have_clk_lane || bus->num_data_lanes > 0) {
+ } else {
flags |= V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
}
- if (lanes_used || have_clk_lane || flags) {
+ if (lanes_used || have_clk_lane ||
+ (flags & ~V4L2_MBUS_CSI2_CONTINUOUS_CLOCK)) {
bus->flags = flags;
vep->bus_type = V4L2_MBUS_CSI2;
}
--
2.11.0
^ permalink raw reply related
* Re: [PATCH v1] earlyprintk configuration for rk3399 boards
From: Ihor Matushchak @ 2018-07-23 14:47 UTC (permalink / raw)
To: Julien Grall
Cc: xen-devel, Stefano Stabellini,
Ігор Матущак,
xen-devel
In-Reply-To: <223c2116-0788-fb95-f3d1-7da0c3568515@arm.com>
[-- Attachment #1.1: Type: text/plain, Size: 2193 bytes --]
Hi Julien,
Sure, I would be glad to do that.
I suppose it should be placed somewhere on wiki.xenproject.org?
*BR,*
*Ihor Matushchak*
2018-07-23 17:33 GMT+03:00 Julien Grall <julien.grall@arm.com>:
> On 06/07/18 12:04, Ігор Матущак wrote:
>
>> Hello Julien,
>>
>
> Hi Ihor,
>
> Sorry for the late reply.
>
>
>> I suppose there is no such documentation, at least I didn't find any.
>> Bringing up XEN 4.10.0 on RK3399 is my pet-project.
>> My current target board is Ibox3399 <https://www.aliexpress.com/it
>> em/RK3399-Development-Board-Ibox3399-2GB-DDR3-16GB-EMMC-Six-
>> Core-A72-A53-Mali-T860-GPU-Android6/32816273232.html>
>>
>> At the moment I got dom0 running on this board and some test guest domain
>> (both 4.4 kernels).
>> Actually no changes made to XEN (except earlyprintk) at the moment, Xen
>> works from the box.
>>
>
> Glad to see Xen booting out of box on RK3399 :).
>
> The alias is only for convience. It would be possible to do the same with
> 8250,0xff1a0000,2.
>
> So instead of that patch, I would suggest to write down a documentation
> for booting Xen on the board and early debugging.
>
> What do you think?
>
> Cheers,
>
>
>> /BR,/
>> /Ihor Matushchak/
>>
>> 2018-07-06 13:36 GMT+03:00 Julien Grall <julien.grall@arm.com <mailto:
>> julien.grall@arm.com>>:
>>
>> Hello,
>>
>> On 04/07/18 21:55, ihor.matushchak@foobox.net
>> <mailto:ihor.matushchak@foobox.net> wrote:
>>
>> From: Ihor Matushchak <ihor.matushchak@foobox.net
>> <mailto:ihor.matushchak@foobox.net>>
>>
>> This patch enables earlyprintk for Rockchip rk3399 based SoC.
>>
>> Is there any missing pieces in Xen to boot on Rockchip? I would also
>> quite like to see some documentation how to boot Xen on that platform.
>>
>> Cheers,
>>
>>
>>
>> Ihor Matushchak (1):
>> xen:arm:earlyprintk configuration for rk3399 boards
>>
>> docs/misc/arm/early-printk.txt | 1 +
>> xen/arch/arm/Rules.mk | 1 +
>> 2 files changed, 2 insertions(+)
>>
>>
>> -- Julien Grall
>>
>>
>>
> --
> Julien Grall
>
[-- Attachment #1.2: Type: text/html, Size: 3920 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply
* [U-Boot] [PATCH v2 5/5] Kconfig: Sort bool, default, select and imply options
From: Tom Rini @ 2018-07-23 14:47 UTC (permalink / raw)
To: u-boot
In-Reply-To: <40bfb61f2c4a52a31b26db68dc91caa0f07fda7c.1532354106.git.michal.simek@xilinx.com>
On Mon, Jul 23, 2018 at 03:55:15PM +0200, Michal Simek wrote:
> Another round of sorting Kconfig entries aplhabetically.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/47cf8cca/attachment.sig>
^ permalink raw reply
* [Bug 107324] Radeon driver fails to install with modprobe: ERROR: could not insert 'radeon': Invalid argument
From: bugzilla-daemon @ 2018-07-23 14:47 UTC (permalink / raw)
To: dri-devel
In-Reply-To: <bug-107324-502@http.bugs.freedesktop.org/>
[-- Attachment #1.1: Type: text/plain, Size: 543 bytes --]
https://bugs.freedesktop.org/show_bug.cgi?id=107324
--- Comment #11 from Christian König <ckoenig.leichtzumerken@gmail.com> ---
The issue with commit 32167016076f714f0e35e287fbead7de0f1fb179 is that it fixed
things quite a bunch of people, but unfortunately also broke things for some
other.
So far we tried to mitigate problems by avoiding known to be problematic
configurations, but but it is really hard to find documentation for such old
hardware.
--
You are receiving this mail because:
You are the assignee for the bug.
[-- Attachment #1.2: Type: text/html, Size: 1458 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* [U-Boot] [PATCH v2 4/5] dm: Change CMD_DM enabling
From: Tom Rini @ 2018-07-23 14:47 UTC (permalink / raw)
To: u-boot
In-Reply-To: <d050641bc179214f85795cd725272db02ef3e176.1532354106.git.michal.simek@xilinx.com>
On Mon, Jul 23, 2018 at 03:55:14PM +0200, Michal Simek wrote:
> CMD_DM is used for debug purpose and it shouldn't be enabled by default
> via Kconfig. Unfortunately this is in the tree for quite a long time
> that's why solution is to use imply DM for all targets which are
> enabling DM.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/80c6a72c/attachment.sig>
^ permalink raw reply
* [U-Boot] [PATCH v2 3/5] Kconfig: Sort bool, default, select and imply options
From: Tom Rini @ 2018-07-23 14:47 UTC (permalink / raw)
To: u-boot
In-Reply-To: <90eb502ea9b3814324ca18083c0cbc1353f060cf.1532354106.git.michal.simek@xilinx.com>
On Mon, Jul 23, 2018 at 03:55:13PM +0200, Michal Simek wrote:
> Fix Kconfig bool, default, select and imply options to be
> alphabetically sorted.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/9c29e192/attachment.sig>
^ permalink raw reply
* [U-Boot] [PATCH v2 1/5] common: Log should depends on DM not be selected by DM
From: Tom Rini @ 2018-07-23 14:47 UTC (permalink / raw)
To: u-boot
In-Reply-To: <c066c7007bdf6864e8695477fb28c091f1f6e9bf.1532354106.git.michal.simek@xilinx.com>
On Mon, Jul 23, 2018 at 03:55:11PM +0200, Michal Simek wrote:
> Better use depends on instead of select.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/940b4c49/attachment.sig>
^ permalink raw reply
* [U-Boot] [PATCH v2 2/5] Kconfig: Replace spaces with tabs and missing newline
From: Tom Rini @ 2018-07-23 14:47 UTC (permalink / raw)
To: u-boot
In-Reply-To: <63338de092757ae28bcc709354831f0475766686.1532354106.git.michal.simek@xilinx.com>
On Mon, Jul 23, 2018 at 03:55:12PM +0200, Michal Simek wrote:
> Trivial Kconfig cleanup. Use tabs instead of spaces and every Kconfig
> entry should be separated by newline.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/f95e0013/attachment.sig>
^ permalink raw reply
* [U-Boot] cmd: Make CMD_NAND imply NAND
From: Tom Rini @ 2018-07-23 14:47 UTC (permalink / raw)
To: u-boot
In-Reply-To: <20180708125030.20541-1-aford173@gmail.com>
On Sun, Jul 08, 2018 at 07:50:28AM -0500, Adam Ford wrote:
> Many boards check for CMD_NAND and not NAND. This makes CMD_NAND
> imply NAND which will make some Kconfig migration of some NAND
> options easier later.
>
> Rsync all defconfig files using moveconfig.py
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
As-is, I get a Kconfig dependency loop. Please re-spin this and then
I'll do a size-check on it, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/6c3f0d4d/attachment.sig>
^ permalink raw reply
* [U-Boot] Convert CONFIG_MTD_PARTITIONS et al to Kconfig
From: Tom Rini @ 2018-07-23 14:47 UTC (permalink / raw)
To: u-boot
In-Reply-To: <20180708031826.29992-1-aford173@gmail.com>
On Sat, Jul 07, 2018 at 10:18:22PM -0500, Adam Ford wrote:
> This converts the following to Kconfig:
> CONFIG_MTD_PARTITIONS
> CONFIG_MTD_DEVICE
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/README b/README
> index b1ddf89fc5..aee0f7371c 100644
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/848843ce/attachment.sig>
^ permalink raw reply
* [U-Boot] configs: Convert CONFIG_USE_NAND to CONFIG_NAND
From: Tom Rini @ 2018-07-23 14:47 UTC (permalink / raw)
To: u-boot
In-Reply-To: <20180710114733.5848-1-aford173@gmail.com>
On Tue, Jul 10, 2018 at 06:47:33AM -0500, Adam Ford wrote:
> The DA850-EVM and OMAPL138_LCDK both use checks for CONFIG_USE_NAND.
> This patch changes these checks to CONFIG_NAND which is already defined
> in Kconfig. Since the OMAPL138_LCDK already had CONFIG_NAND defined in its
> defconfig, it can be deleted from configs/omapl138_lcdk.h.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
> index ebfdd1c7a3..6690be60b6 100644
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/bc3d8b8d/attachment.sig>
^ permalink raw reply
* [U-Boot] Convert CONFIG_NAND_ATMEL to Kconfig
From: Tom Rini @ 2018-07-23 14:47 UTC (permalink / raw)
To: u-boot
In-Reply-To: <20180708131108.21327-1-aford173@gmail.com>
On Sun, Jul 08, 2018 at 08:11:07AM -0500, Adam Ford wrote:
> This converts the following to Kconfig:
> CONFIG_NAND_ATMEL
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/configs/at91sam9260ek_dataflash_cs0_defconfig b/configs/at91sam9260ek_dataflash_cs0_defconfig
> index 3d2b8803ea..c77b8d8a20 100644
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/4bbd9b12/attachment.sig>
^ permalink raw reply
* [U-Boot] configs: Make NAND_BOOT and ONENAND_BOOT imply NAND
From: Tom Rini @ 2018-07-23 14:46 UTC (permalink / raw)
To: u-boot
In-Reply-To: <20180708122811.21033-1-aford173@gmail.com>
On Sun, Jul 08, 2018 at 07:28:10AM -0500, Adam Ford wrote:
> Some boards indicate support from booting NAND or
> ONENAND booting, but don't enable the CONFIG_NAND. This
> makes those boards imply NAND which will make
> enabling other flags that are dependent on CONFIG_NAND
> possible and easier to migrate.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/common/Kconfig b/common/Kconfig
> index 4c7a1a9af8..a22268cbf9 100644
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/c56c7bfe/attachment.sig>
^ permalink raw reply
* [U-Boot] Convert CONFIG_NAND_DAVINCI to Kconfig
From: Tom Rini @ 2018-07-23 14:46 UTC (permalink / raw)
To: u-boot
In-Reply-To: <20180708114337.18315-1-aford173@gmail.com>
On Sun, Jul 08, 2018 at 06:43:36AM -0500, Adam Ford wrote:
> This converts the following to Kconfig:
> CONFIG_NAND_DAVINCI
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/configs/ea20_defconfig b/configs/ea20_defconfig
> index 497e5515d7..43292a126d 100644
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180723/f72ed9f2/attachment.sig>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.