pic64gx soc driver/binding changes
Conor Dooley
maintainercover pic64gx soc driver/binding changes
From: Conor Dooley <[email protected]>
Mostly this is stuff that PH did last year, but rebased on top of current work.
Conor Dooley (1):
dt-bindings: soc: microchip: add compatible for the mss-top-sysreg on
pic64gx
Pierre-Henry Moussay (2):
dt-bindings: soc: microchip: mpfs-sys-controller: Add pic64gx
compatibility
soc: microchip: mpfs-sys-controller: add support for pic64gx
.../microchip,mpfs-mss-top-sysreg.yaml | 14 +++- .../microchip,mpfs-sys-controller.yaml | 4 +- drivers/soc/microchip/mpfs-sys-controller.c | 74 ++++++++++++++----- 3 files changed, 67 insertions(+), 25 deletions(-)
Signature · 1 line
2.51.0
Conor Dooley
maintainerPATCH 1/3 dt-bindings: soc: microchip: add compatible for the mss-top-sysreg on pic64gx
From: Conor Dooley <[email protected]>
pic64gx has an identical sysreg syscon to mpfs, add it using a fallback.
--- .../microchip/microchip,mpfs-mss-top-sysreg.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/soc/microchip/microchip,mpfs-mss-top-sysreg.yaml +10 -4
@@ -15,10 +15,16 @@ description: properties: compatible: - items: - - const: microchip,mpfs-mss-top-sysreg - - const: syscon - - const: simple-mfd + oneOf: + - items: + - const: microchip,mpfs-mss-top-sysreg + - const: syscon + - const: simple-mfd + - items: + - const: microchip,pic64gx-mss-top-sysreg + - const: microchip,mpfs-mss-top-sysreg + - const: syscon + - const: simple-mfd reg: maxItems: 1
Signature · 1 line
2.51.0
Re: [PATCH v1 1/3] dt-bindings: soc: microchip: add compatible for the mss-top-sysreg on pic64gx
Quoted 9 lines · Conor Dooley
From: Conor Dooley <[email protected]>
pic64gx has an identical sysreg syscon to mpfs, add it using a fallback.
Signed-off-by Conor Dooley <[email protected]>--- .../microchip/microchip,mpfs-mss-top-sysreg.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
Conor Dooley
maintainerPATCH 2/3 dt-bindings: soc: microchip: mpfs-sys-controller: Add pic64gx compatibility
In reply to Conor DooleyFrom: Pierre-Henry Moussay <[email protected]>
pic64gx is not compatible with mpfs because due to the lack of FPGA functionality some features are disabled. Notably, anything to do with FPGA fabric contents is not supported.
--- .../bindings/soc/microchip/microchip,mpfs-sys-controller.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/soc/microchip/microchip,mpfs-sys-controller.yaml +3 -1
@@ -24,7 +24,9 @@ properties: maxItems: 1 compatible: - const: microchip,mpfs-sys-controller + enum: + - microchip,mpfs-sys-controller + - microchip,pic64gx-sys-controller microchip,bitstream-flash: $ref: /schemas/types.yaml#/definitions/phandle
Signature · 1 line
2.51.0
Re: [PATCH v1 2/3] dt-bindings: soc: microchip: mpfs-sys-controller: Add pic64gx compatibility
Quoted 6 lines · Conor Dooley
From: Pierre-Henry Moussay <[email protected]>
pic64gx is not compatible with mpfs because due to the lack of FPGA functionality some features are disabled. Notably, anything to do with FPGA fabric contents is not supported.
Quoted 6 lines
Signed-off-by Pierre-Henry Moussay <[email protected]>Signed-off-by Conor Dooley <[email protected]>--- .../bindings/soc/microchip/microchip,mpfs-sys-controller.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Conor Dooley
maintainerPATCH 3/3 soc: microchip: mpfs-sys-controller: add support for pic64gx
In reply to Conor DooleyFrom: Pierre-Henry Moussay <[email protected]>
pic64gx is not compatible with mpfs because due to the lack of FPGA functionality some features are disabled. Notably, anything to do with FPGA fabric contents is not supported.
--- drivers/soc/microchip/mpfs-sys-controller.c | 74 +++++++++++++++------ 1 file changed, 54 insertions(+), 20 deletions(-)
drivers/soc/microchip/mpfs-sys-controller.c +54 -20
@@ -36,6 +36,11 @@ struct mpfs_sys_controller {struct kref consumers; }; +struct mpfs_syscon_config { +unsigned int nb_subdevs; +struct platform_device *subdevs; +}; +int mpfs_blocking_transaction (struct mpfs_sys_controller *sys_controller,struct mpfs_mss_msg *msg) {unsigned long timeout =msecs_to_jiffies (MPFS_SYS_CTRL_TIMEOUT_MS );
@@ -110,25 +115,11 @@ struct mtd_info *mpfs_sys_controller_get_flash(struct mpfs_sys_controller *mpfs_ }EXPORT_SYMBOL (mpfs_sys_controller_get_flash); -static struct platform_device subdevs[] = { - { - .name ="mpfs-rng" , - .id =-1 , - }, - { - .name ="mpfs-generic-service" , - .id =-1 , - }, - { - .name ="mpfs-auto-update" , - .id =-1 , - }, -}; -static int mpfs_sys_controller_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct mpfs_sys_controller *sys_controller; +struct mpfs_syscon_config *of_data;struct device_node *np;int i, ret;
@@ -164,11 +155,17 @@ static int mpfs_sys_controller_probe(struct platform_device *pdev)platform_set_drvdata (pdev, sys_controller); + of_data = (struct mpfs_syscon_config *)device_get_match_data (dev); +if (!of_data) { +dev_err (dev,"Error getting match data\n" ); +return -EINVAL ; + } -for (i =0 ; i <ARRAY_SIZE (subdevs); i++) { - subdevs[i].dev.parent = dev; -if (platform_device_register (&subdevs[i])) -dev_warn (dev,"Error registering sub device %s\n" , subdevs[i].name); +for (i =0 ; i < of_data->nb_subdevs; i++) { + of_data->subdevs[i].dev.parent = dev; +if (platform_device_register (&of_data->subdevs[i])) +dev_warn (dev,"Error registering sub device %s\n" , + of_data->subdevs[i].name); }dev_info (&pdev->dev,"Registered MPFS system controller\n" );
@@ -183,8 +180,45 @@ static void mpfs_sys_controller_remove(struct platform_device *pdev)mpfs_sys_controller_put (sys_controller); } +static struct platform_device mpfs_subdevs[] = { + { + .name ="mpfs-rng" , + .id =-1 , + }, + { + .name ="mpfs-generic-service" , + .id =-1 , + }, + { + .name ="mpfs-auto-update" , + .id =-1 , + }, +}; + +static struct platform_device pic64gx_subdevs[] = { + { + .name ="mpfs-rng" , + .id =-1 , + }, + { + .name ="mpfs-generic-service" , + .id =-1 , + }, +}; + +static const struct mpfs_syscon_config mpfs_config = { + .nb_subdevs =ARRAY_SIZE (mpfs_subdevs), + .subdevs = mpfs_subdevs, +}; + +static const struct mpfs_syscon_config pic64gx_config = { + .nb_subdevs =ARRAY_SIZE (pic64gx_subdevs), + .subdevs = pic64gx_subdevs, +}; +static const struct of_device_id mpfs_sys_controller_of_match[] = { - {.compatible ="microchip,mpfs-sys-controller" , }, + {.compatible ="microchip,mpfs-sys-controller" , .data = &mpfs_config}, + {.compatible ="microchip,pic64gx-sys-controller" , .data = &pic64gx_config}, {}, };MODULE_DEVICE_TABLE (of, mpfs_sys_controller_of_match);
Signature · 1 line
2.51.0
From: Conor Dooley <[email protected]>
Quoted 13 lines · Conor Dooley
From: Conor Dooley <[email protected]>
Mostly this is stuff that PH did last year, but rebased on top of current work.
CC Conor Dooley <[email protected]>CC Rob Herring <[email protected]>CC Krzysztof Kozlowski <[email protected]>CC Daire McNamara <[email protected]>
Quoted 1 line
[...]
Applied to riscv-soc-drivers-for-next, thanks!
[1/3] dt-bindings: soc: microchip: add compatible for the mss-top-sysreg on pic64gx
https://git.kernel.org/conor/c/7a58baed883a [2/3] dt-bindings: soc: microchip: mpfs-sys-controller: Add pic64gx compatibility https://git.kernel.org/conor/c/ecc09da7ba34 [3/3] soc: microchip: mpfs-sys-controller: add support for pic64gx https://git.kernel.org/conor/c/63b5305ad84d
Thanks,
Conor.