mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 00:24:12 +08:00
Memory controller drivers for v5.19
1. Exynos: Reduce memory usage/allocation in Exynos5422 DMC driver. 2. Renesas: - Add bindings for R-Car H3/M3/E3. - Simplify single/double data register access. 3. Minor cleanups: TI/EMIF and FSL/Corenet. -----BEGIN PGP SIGNATURE----- iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmJftYYQHGtyemtAa2Vy bmVsLm9yZwAKCRDBN2bmhouD18awD/475+blRKT0B7jsNpsUEdDcQR/nRYj5cgnf GLNwNJet05PSug6kaWZ+6fmEHETcMuduBRZmtZnc9wNO4Z+HkXSVvnHbU4MlF3cF ORgtTwUPeHz1D4mVbvHUVifjkM/qwWfVh9xJnN7i/Afk4xe8IxsfJQwCFm5QixIE iMVBe1idiEppiFEqtSp8JSWvLaEbCd6ULpbK8aJmpPp6rUu9dHuN4jPwdgd2tjmK A3bGH3QWm+ujQYZvjrrayvur8sTHI+SGy8I5GFHRY09R+kFZKvcKiEJ4WfaNZt4+ Dt2cAmKHLqxxWSr1QOrq/zIY69hB7zngmh3PTwbFA++7peDmnwhVZGEUoWEnkLar nDyf46uTxs+OU6qW/78WWTDo4OLrOIce0LF/ctXpFa8BV4JuTI2QH4YAxuppeowu ssPu/IaBOJ5anPdxoJ3XufWsPf6OlpIGnvJGSBrNZfRONJNNudvvZOODi0C0pDU+ +c/85dBxiquV56BRFmRH0aWoSN3jx9Zo2pRcn4YQU75KmH9I5Jj6Ux3a//lIEMvr WSYl4MNfDxJLKhzdMZN7562rfeWOmhCLIneEciHYkuRH/L38v+moXmK/TP+qzq31 mlnNYpMGLHhCOcCWMeyEfGCQ1/ah4v5LOMEbL8wcqAwoYhozwIlhyRm54QM718Eh FKOB2Mp3/w== =cpzI -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmJhchQACgkQmmx57+YA GNm49g//bZ8xWgK/3762GgP6D8K/OS06/hS0BVmPTQ389R2xnsUBTguM5B+lICTV DzgVXA73Pvo6J3KiSsmRIbjGXbNFiTpnsKKkwhLXP97QupsWSImnsgoliWWvEZ7w exHmxTbIRW0AyMZV/EbLuH3OWWc7Unelg8o2P0kV91AkMZZmE25y1qekD4XlFy6i b/Wum/CYm5JMQ6wddKtCPUtaRfkhSO1PGc/nCAkIUVGiuuV3AsIM5hpBPqYZWaUg z/qU5sEXUytLCXSUt78nTUAzuvJpH6VcD8b2Ha8VUZe2nTEdQnXpPr1V06vcWDlo gu4/HrlML2ESvSp2b05uaRozzdFX+ixh5eGV9U3Q0M/t6gN/un+vY5Q/wRVEyqYF CaGwEXiOmIg5BiJT/MzJfvKsHsqsv24uWkOS7fbNqSsMS1LQmnAVZ4Rws8RhIEvd ChkI8IWz5D9ojuJl/L1C9N+ivs2b88GrpnTia0sKV8JIFPJnh5m5+x+t4fBQJBFI JM954U7BnbemvRTxJoEAkBA79AtCncO8NNw8HRtPQlkgqgeN2eGrTXyZcQ3iARtb k+Q4IN2EPX3tCIW1PjiYbwUP6wvvCc/zZOMeXvM+6LABIx8cd7uTdgTJs35Ta4Ms lBSKppqP3onphJHND7gltOWVpwIAMO6U/uXaDUiNm6FhdyVxj88= =6DSb -----END PGP SIGNATURE----- Merge tag 'memory-controller-drv-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v5.19 1. Exynos: Reduce memory usage/allocation in Exynos5422 DMC driver. 2. Renesas: - Add bindings for R-Car H3/M3/E3. - Simplify single/double data register access. 3. Minor cleanups: TI/EMIF and FSL/Corenet. * tag 'memory-controller-drv-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: fsl-corenet-cf: Use helper function devm_platform_ioremap_resource() memory: renesas-rpc-if: Simplify single/double data register access dt-bindings: memory: renesas,rpc-if: Document R-Car H3/M3/E3 support memory: emif: remove unneeded ENOMEM error messages memory: samsung: exynos5422-dmc: Avoid some over memory allocation Link: https://lore.kernel.org/r/20220420072712.12648-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
54711ee4f6
@ -31,8 +31,13 @@ properties:
|
||||
- renesas,r8a774b1-rpc-if # RZ/G2N
|
||||
- renesas,r8a774c0-rpc-if # RZ/G2E
|
||||
- renesas,r8a774e1-rpc-if # RZ/G2H
|
||||
- renesas,r8a7795-rpc-if # R-Car H3
|
||||
- renesas,r8a7796-rpc-if # R-Car M3-W
|
||||
- renesas,r8a77961-rpc-if # R-Car M3-W+
|
||||
- renesas,r8a77965-rpc-if # R-Car M3-N
|
||||
- renesas,r8a77970-rpc-if # R-Car V3M
|
||||
- renesas,r8a77980-rpc-if # R-Car V3H
|
||||
- renesas,r8a77990-rpc-if # R-Car E3
|
||||
- renesas,r8a77995-rpc-if # R-Car D3
|
||||
- renesas,r8a779a0-rpc-if # R-Car V3U
|
||||
- const: renesas,rcar-gen3-rpc-if # a generic R-Car gen3 or RZ/G2{E,H,M,N} device
|
||||
|
@ -1025,10 +1025,8 @@ static struct emif_data *__init_or_module get_device_details(
|
||||
temp = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
|
||||
dev_info = devm_kzalloc(dev, sizeof(*dev_info), GFP_KERNEL);
|
||||
|
||||
if (!emif || !temp || !dev_info) {
|
||||
dev_err(dev, "%s:%d: allocation error\n", __func__, __LINE__);
|
||||
if (!emif || !temp || !dev_info)
|
||||
goto error;
|
||||
}
|
||||
|
||||
memcpy(temp, pd, sizeof(*pd));
|
||||
pd = temp;
|
||||
@ -1067,9 +1065,6 @@ static struct emif_data *__init_or_module get_device_details(
|
||||
temp = devm_kzalloc(dev, sizeof(*cust_cfgs), GFP_KERNEL);
|
||||
if (temp)
|
||||
memcpy(temp, cust_cfgs, sizeof(*cust_cfgs));
|
||||
else
|
||||
dev_warn(dev, "%s:%d: allocation error\n", __func__,
|
||||
__LINE__);
|
||||
pd->custom_configs = temp;
|
||||
}
|
||||
|
||||
@ -1084,8 +1079,6 @@ static struct emif_data *__init_or_module get_device_details(
|
||||
memcpy(temp, pd->timings, size);
|
||||
pd->timings = temp;
|
||||
} else {
|
||||
dev_warn(dev, "%s:%d: allocation error\n", __func__,
|
||||
__LINE__);
|
||||
get_default_timings(emif);
|
||||
}
|
||||
} else {
|
||||
@ -1098,8 +1091,6 @@ static struct emif_data *__init_or_module get_device_details(
|
||||
memcpy(temp, pd->min_tck, sizeof(*pd->min_tck));
|
||||
pd->min_tck = temp;
|
||||
} else {
|
||||
dev_warn(dev, "%s:%d: allocation error\n", __func__,
|
||||
__LINE__);
|
||||
pd->min_tck = &lpddr2_jedec_min_tck;
|
||||
}
|
||||
} else {
|
||||
|
@ -172,7 +172,6 @@ out:
|
||||
static int ccf_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct ccf_private *ccf;
|
||||
struct resource *r;
|
||||
const struct of_device_id *match;
|
||||
u32 errinten;
|
||||
int ret, irq;
|
||||
@ -185,13 +184,7 @@ static int ccf_probe(struct platform_device *pdev)
|
||||
if (!ccf)
|
||||
return -ENOMEM;
|
||||
|
||||
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!r) {
|
||||
dev_err(&pdev->dev, "%s: no mem resource\n", __func__);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
ccf->regs = devm_ioremap_resource(&pdev->dev, r);
|
||||
ccf->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(ccf->regs))
|
||||
return PTR_ERR(ccf->regs);
|
||||
|
||||
|
@ -458,7 +458,7 @@ int rpcif_manual_xfer(struct rpcif *rpc)
|
||||
case RPCIF_DATA_OUT:
|
||||
while (pos < rpc->xferlen) {
|
||||
u32 bytes_left = rpc->xferlen - pos;
|
||||
u32 nbytes, data[2];
|
||||
u32 nbytes, data[2], *p = data;
|
||||
|
||||
smcr = rpc->smcr | RPCIF_SMCR_SPIE;
|
||||
|
||||
@ -471,15 +471,9 @@ int rpcif_manual_xfer(struct rpcif *rpc)
|
||||
regmap_write(rpc->regmap, RPCIF_SMENR, smenr);
|
||||
|
||||
memcpy(data, rpc->buffer + pos, nbytes);
|
||||
if (nbytes == 8) {
|
||||
regmap_write(rpc->regmap, RPCIF_SMWDR1,
|
||||
data[0]);
|
||||
regmap_write(rpc->regmap, RPCIF_SMWDR0,
|
||||
data[1]);
|
||||
} else {
|
||||
regmap_write(rpc->regmap, RPCIF_SMWDR0,
|
||||
data[0]);
|
||||
}
|
||||
if (nbytes == 8)
|
||||
regmap_write(rpc->regmap, RPCIF_SMWDR1, *p++);
|
||||
regmap_write(rpc->regmap, RPCIF_SMWDR0, *p);
|
||||
|
||||
regmap_write(rpc->regmap, RPCIF_SMCR, smcr);
|
||||
ret = wait_msg_xfer_end(rpc);
|
||||
@ -521,7 +515,7 @@ int rpcif_manual_xfer(struct rpcif *rpc)
|
||||
}
|
||||
while (pos < rpc->xferlen) {
|
||||
u32 bytes_left = rpc->xferlen - pos;
|
||||
u32 nbytes, data[2];
|
||||
u32 nbytes, data[2], *p = data;
|
||||
|
||||
/* nbytes may only be 1, 2, 4, or 8 */
|
||||
nbytes = bytes_left >= max ? max : (1 << ilog2(bytes_left));
|
||||
@ -537,15 +531,9 @@ int rpcif_manual_xfer(struct rpcif *rpc)
|
||||
if (ret)
|
||||
goto err_out;
|
||||
|
||||
if (nbytes == 8) {
|
||||
regmap_read(rpc->regmap, RPCIF_SMRDR1,
|
||||
&data[0]);
|
||||
regmap_read(rpc->regmap, RPCIF_SMRDR0,
|
||||
&data[1]);
|
||||
} else {
|
||||
regmap_read(rpc->regmap, RPCIF_SMRDR0,
|
||||
&data[0]);
|
||||
}
|
||||
if (nbytes == 8)
|
||||
regmap_read(rpc->regmap, RPCIF_SMRDR1, p++);
|
||||
regmap_read(rpc->regmap, RPCIF_SMRDR0, p);
|
||||
memcpy(rpc->buffer + pos, data, nbytes);
|
||||
|
||||
pos += nbytes;
|
||||
|
@ -1322,7 +1322,6 @@ static int exynos5_dmc_init_clks(struct exynos5_dmc *dmc)
|
||||
*/
|
||||
static int exynos5_performance_counters_init(struct exynos5_dmc *dmc)
|
||||
{
|
||||
int counters_size;
|
||||
int ret, i;
|
||||
|
||||
dmc->num_counters = devfreq_event_get_edev_count(dmc->dev,
|
||||
@ -1332,8 +1331,8 @@ static int exynos5_performance_counters_init(struct exynos5_dmc *dmc)
|
||||
return dmc->num_counters;
|
||||
}
|
||||
|
||||
counters_size = sizeof(struct devfreq_event_dev) * dmc->num_counters;
|
||||
dmc->counter = devm_kzalloc(dmc->dev, counters_size, GFP_KERNEL);
|
||||
dmc->counter = devm_kcalloc(dmc->dev, dmc->num_counters,
|
||||
sizeof(*dmc->counter), GFP_KERNEL);
|
||||
if (!dmc->counter)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user