Skip to content

Commit e855cbf

Browse files
committed
Merge tag 'memory-controller-drv-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers
Memory controller drivers for v6.7 1. Atmel: Use __counted_by annotation. 2. Tegra: Add Tegra234 clients for RCE and VI. 3. Cleanup: - Use device_get_match_data() to simplify the code, - Make "additionalProperties: true" explicit in Devicetree bindings. * tag 'memory-controller-drv-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: Use device_get_match_data() memory: tegra: Add Tegra234 clients for RCE and VI dt-bindings: memory-controllers: Make "additionalProperties: true" explicit memory: atmel-ebi: Annotate struct atmel_ebi_dev with __counted_by Link: https://lore.kernel.org/r/20231016074013.28286-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 1780d27 + 09de369 commit e855cbf

7 files changed

Lines changed: 77 additions & 24 deletions

File tree

Documentation/devicetree/bindings/memory-controllers/ingenic,nemc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ patternProperties:
4040
".*@[0-9]+$":
4141
type: object
4242
$ref: mc-peripheral-props.yaml#
43+
additionalProperties: true
4344

4445
required:
4546
- compatible

Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ properties:
8080
patternProperties:
8181
"flash@[0-9a-f]+$":
8282
type: object
83+
additionalProperties: true
84+
8385
properties:
8486
compatible:
8587
contains:

Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ patternProperties:
130130
bus. The device can be a NAND chip, SRAM device, NOR device
131131
or an ASIC.
132132
$ref: ti,gpmc-child.yaml
133-
133+
additionalProperties: true
134134

135135
required:
136136
- compatible

drivers/memory/atmel-ebi.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
#include <linux/mfd/syscon/atmel-matrix.h>
1313
#include <linux/mfd/syscon/atmel-smc.h>
1414
#include <linux/init.h>
15-
#include <linux/of_device.h>
15+
#include <linux/of.h>
16+
#include <linux/of_platform.h>
17+
#include <linux/platform_device.h>
18+
#include <linux/property.h>
1619
#include <linux/regmap.h>
1720
#include <soc/at91/atmel-sfr.h>
1821

@@ -30,7 +33,7 @@ struct atmel_ebi_dev {
3033
struct atmel_ebi *ebi;
3134
u32 mode;
3235
int numcs;
33-
struct atmel_ebi_dev_config configs[];
36+
struct atmel_ebi_dev_config configs[] __counted_by(numcs);
3437
};
3538

3639
struct atmel_ebi_caps {
@@ -515,24 +518,21 @@ static int atmel_ebi_probe(struct platform_device *pdev)
515518
{
516519
struct device *dev = &pdev->dev;
517520
struct device_node *child, *np = dev->of_node, *smc_np;
518-
const struct of_device_id *match;
519521
struct atmel_ebi *ebi;
520522
int ret, reg_cells;
521523
struct clk *clk;
522524
u32 val;
523525

524-
match = of_match_device(atmel_ebi_id_table, dev);
525-
if (!match || !match->data)
526-
return -EINVAL;
527-
528526
ebi = devm_kzalloc(dev, sizeof(*ebi), GFP_KERNEL);
529527
if (!ebi)
530528
return -ENOMEM;
531529

532530
platform_set_drvdata(pdev, ebi);
533531

534532
INIT_LIST_HEAD(&ebi->devs);
535-
ebi->caps = match->data;
533+
ebi->caps = device_get_match_data(dev);
534+
if (!ebi->caps)
535+
return -EINVAL;
536536
ebi->dev = dev;
537537

538538
clk = devm_clk_get(dev, NULL);

drivers/memory/brcmstb_memc.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
#include <linux/io.h>
99
#include <linux/kernel.h>
1010
#include <linux/module.h>
11-
#include <linux/of_device.h>
11+
#include <linux/of.h>
1212
#include <linux/platform_device.h>
13+
#include <linux/property.h>
1314

1415
#define REG_MEMC_CNTRLR_CONFIG 0x00
1516
#define CNTRLR_CONFIG_LPDDR4_SHIFT 5
@@ -121,12 +122,9 @@ static struct attribute_group dev_attr_group = {
121122
.attrs = dev_attrs,
122123
};
123124

124-
static const struct of_device_id brcmstb_memc_of_match[];
125-
126125
static int brcmstb_memc_probe(struct platform_device *pdev)
127126
{
128127
const struct brcmstb_memc_data *memc_data;
129-
const struct of_device_id *of_id;
130128
struct device *dev = &pdev->dev;
131129
struct brcmstb_memc *memc;
132130
int ret;
@@ -137,8 +135,7 @@ static int brcmstb_memc_probe(struct platform_device *pdev)
137135

138136
dev_set_drvdata(dev, memc);
139137

140-
of_id = of_match_device(brcmstb_memc_of_match, dev);
141-
memc_data = of_id->data;
138+
memc_data = device_get_match_data(dev);
142139
memc->srpd_offset = memc_data->srpd_offset;
143140

144141
memc->ddr_ctrl = devm_platform_ioremap_resource(pdev, 0);

drivers/memory/fsl-corenet-cf.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
#include <linux/irq.h>
1111
#include <linux/module.h>
1212
#include <linux/of.h>
13-
#include <linux/of_address.h>
14-
#include <linux/of_device.h>
15-
#include <linux/of_irq.h>
1613
#include <linux/platform_device.h>
14+
#include <linux/property.h>
1715

1816
enum ccf_version {
1917
CCF1,
@@ -172,14 +170,9 @@ static irqreturn_t ccf_irq(int irq, void *dev_id)
172170
static int ccf_probe(struct platform_device *pdev)
173171
{
174172
struct ccf_private *ccf;
175-
const struct of_device_id *match;
176173
u32 errinten;
177174
int ret, irq;
178175

179-
match = of_match_device(ccf_matches, &pdev->dev);
180-
if (WARN_ON(!match))
181-
return -ENODEV;
182-
183176
ccf = devm_kzalloc(&pdev->dev, sizeof(*ccf), GFP_KERNEL);
184177
if (!ccf)
185178
return -ENOMEM;
@@ -189,7 +182,7 @@ static int ccf_probe(struct platform_device *pdev)
189182
return PTR_ERR(ccf->regs);
190183

191184
ccf->dev = &pdev->dev;
192-
ccf->info = match->data;
185+
ccf->info = device_get_match_data(&pdev->dev);
193186
ccf->err_regs = ccf->regs + ccf->info->err_reg_offs;
194187

195188
if (ccf->info->has_brr) {

drivers/memory/tegra/tegra234.c

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,18 @@ static const struct tegra_mc_client tegra234_mc_clients[] = {
449449
.security = 0x38c,
450450
},
451451
},
452+
}, {
453+
.id = TEGRA234_MEMORY_CLIENT_VIW,
454+
.name = "viw",
455+
.bpmp_id = TEGRA_ICC_BPMP_VI,
456+
.type = TEGRA_ICC_ISO_VI,
457+
.sid = TEGRA234_SID_ISO_VI,
458+
.regs = {
459+
.sid = {
460+
.override = 0x390,
461+
.security = 0x394,
462+
},
463+
},
452464
}, {
453465
.id = TEGRA234_MEMORY_CLIENT_NVDECSRD,
454466
.name = "nvdecsrd",
@@ -621,6 +633,30 @@ static const struct tegra_mc_client tegra234_mc_clients[] = {
621633
.security = 0x50c,
622634
},
623635
},
636+
}, {
637+
.id = TEGRA234_MEMORY_CLIENT_VIFALR,
638+
.name = "vifalr",
639+
.bpmp_id = TEGRA_ICC_BPMP_VIFAL,
640+
.type = TEGRA_ICC_ISO_VIFAL,
641+
.sid = TEGRA234_SID_ISO_VIFALC,
642+
.regs = {
643+
.sid = {
644+
.override = 0x5e0,
645+
.security = 0x5e4,
646+
},
647+
},
648+
}, {
649+
.id = TEGRA234_MEMORY_CLIENT_VIFALW,
650+
.name = "vifalw",
651+
.bpmp_id = TEGRA_ICC_BPMP_VIFAL,
652+
.type = TEGRA_ICC_ISO_VIFAL,
653+
.sid = TEGRA234_SID_ISO_VIFALC,
654+
.regs = {
655+
.sid = {
656+
.override = 0x5e8,
657+
.security = 0x5ec,
658+
},
659+
},
624660
}, {
625661
.id = TEGRA234_MEMORY_CLIENT_DLA0RDA,
626662
.name = "dla0rda",
@@ -701,6 +737,30 @@ static const struct tegra_mc_client tegra234_mc_clients[] = {
701737
.security = 0x62c,
702738
},
703739
},
740+
}, {
741+
.id = TEGRA234_MEMORY_CLIENT_RCER,
742+
.name = "rcer",
743+
.bpmp_id = TEGRA_ICC_BPMP_RCE,
744+
.type = TEGRA_ICC_NISO,
745+
.sid = TEGRA234_SID_RCE,
746+
.regs = {
747+
.sid = {
748+
.override = 0x690,
749+
.security = 0x694,
750+
},
751+
},
752+
}, {
753+
.id = TEGRA234_MEMORY_CLIENT_RCEW,
754+
.name = "rcew",
755+
.bpmp_id = TEGRA_ICC_BPMP_RCE,
756+
.type = TEGRA_ICC_NISO,
757+
.sid = TEGRA234_SID_RCE,
758+
.regs = {
759+
.sid = {
760+
.override = 0x698,
761+
.security = 0x69c,
762+
},
763+
},
704764
}, {
705765
.id = TEGRA234_MEMORY_CLIENT_PCIE0R,
706766
.name = "pcie0r",

0 commit comments

Comments
 (0)