mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 18:26:36 +07:00
e6b5be2be4
Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlSOD20ACgkQMUfUDdst+ylLPACg2QrW1oHhdTMT9WI8jihlHVRM 53kAoLeteByQ3iVwWurwwseRPiWa8+MI =OVRS -----END PGP SIGNATURE----- Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
89 lines
1.9 KiB
C
89 lines
1.9 KiB
C
/*
|
|
* Copyright 2011 Freescale Semiconductor, Inc.
|
|
* Copyright 2011 Linaro Ltd.
|
|
*
|
|
* The code contained herein is licensed under the GNU General Public
|
|
* License. You may obtain a copy of the GNU General Public License
|
|
* Version 2 or later at the following locations:
|
|
*
|
|
* http://www.opensource.org/licenses/gpl-license.html
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/io.h>
|
|
#include <linux/module.h>
|
|
#include <linux/of.h>
|
|
#include <linux/of_address.h>
|
|
#include <linux/of_device.h>
|
|
|
|
#define MMDC_MAPSR 0x404
|
|
#define BP_MMDC_MAPSR_PSD 0
|
|
#define BP_MMDC_MAPSR_PSS 4
|
|
|
|
#define MMDC_MDMISC 0x18
|
|
#define BM_MMDC_MDMISC_DDR_TYPE 0x18
|
|
#define BP_MMDC_MDMISC_DDR_TYPE 0x3
|
|
|
|
static int ddr_type;
|
|
|
|
static int imx_mmdc_probe(struct platform_device *pdev)
|
|
{
|
|
struct device_node *np = pdev->dev.of_node;
|
|
void __iomem *mmdc_base, *reg;
|
|
u32 val;
|
|
int timeout = 0x400;
|
|
|
|
mmdc_base = of_iomap(np, 0);
|
|
WARN_ON(!mmdc_base);
|
|
|
|
reg = mmdc_base + MMDC_MDMISC;
|
|
/* Get ddr type */
|
|
val = readl_relaxed(reg);
|
|
ddr_type = (val & BM_MMDC_MDMISC_DDR_TYPE) >>
|
|
BP_MMDC_MDMISC_DDR_TYPE;
|
|
|
|
reg = mmdc_base + MMDC_MAPSR;
|
|
|
|
/* Enable automatic power saving */
|
|
val = readl_relaxed(reg);
|
|
val &= ~(1 << BP_MMDC_MAPSR_PSD);
|
|
writel_relaxed(val, reg);
|
|
|
|
/* Ensure it's successfully enabled */
|
|
while (!(readl_relaxed(reg) & 1 << BP_MMDC_MAPSR_PSS) && --timeout)
|
|
cpu_relax();
|
|
|
|
if (unlikely(!timeout)) {
|
|
pr_warn("%s: failed to enable automatic power saving\n",
|
|
__func__);
|
|
return -EBUSY;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
int imx_mmdc_get_ddr_type(void)
|
|
{
|
|
return ddr_type;
|
|
}
|
|
|
|
static struct of_device_id imx_mmdc_dt_ids[] = {
|
|
{ .compatible = "fsl,imx6q-mmdc", },
|
|
{ /* sentinel */ }
|
|
};
|
|
|
|
static struct platform_driver imx_mmdc_driver = {
|
|
.driver = {
|
|
.name = "imx-mmdc",
|
|
.of_match_table = imx_mmdc_dt_ids,
|
|
},
|
|
.probe = imx_mmdc_probe,
|
|
};
|
|
|
|
static int __init imx_mmdc_init(void)
|
|
{
|
|
return platform_driver_register(&imx_mmdc_driver);
|
|
}
|
|
postcore_initcall(imx_mmdc_init);
|