2019-05-28 16:57:21 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2010-12-08 05:37:59 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) ST-Ericsson SA 2010
|
|
|
|
*
|
|
|
|
* Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/io.h>
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
#include <linux/module.h>
|
2016-06-20 21:01:26 +00:00
|
|
|
#include <linux/random.h>
|
|
|
|
#include <linux/slab.h>
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
#include <linux/of.h>
|
|
|
|
#include <linux/of_address.h>
|
2016-06-20 21:01:26 +00:00
|
|
|
#include <linux/sys_soc.h>
|
2010-12-08 05:37:59 +00:00
|
|
|
|
|
|
|
#include <asm/cputype.h>
|
|
|
|
#include <asm/tlbflush.h>
|
|
|
|
#include <asm/cacheflush.h>
|
|
|
|
#include <asm/mach/map.h>
|
|
|
|
|
2016-06-20 21:01:26 +00:00
|
|
|
/**
|
|
|
|
* struct dbx500_asic_id - fields of the ASIC ID
|
|
|
|
* @process: the manufacturing process, 0x40 is 40 nm 0x00 is "standard"
|
|
|
|
* @partnumber: hithereto 0x8500 for DB8500
|
|
|
|
* @revision: version code in the series
|
|
|
|
*/
|
|
|
|
struct dbx500_asic_id {
|
|
|
|
u16 partnumber;
|
|
|
|
u8 revision;
|
|
|
|
u8 process;
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct dbx500_asic_id dbx500_id;
|
2010-12-08 05:37:59 +00:00
|
|
|
|
2013-05-31 20:47:04 +00:00
|
|
|
static unsigned int __init ux500_read_asicid(phys_addr_t addr)
|
2010-12-08 05:37:59 +00:00
|
|
|
{
|
2016-06-20 21:21:20 +00:00
|
|
|
void __iomem *virt = ioremap(addr, 4);
|
|
|
|
unsigned int asicid;
|
2010-12-08 05:37:59 +00:00
|
|
|
|
2016-06-20 21:21:20 +00:00
|
|
|
if (!virt)
|
|
|
|
return 0;
|
2010-12-08 05:37:59 +00:00
|
|
|
|
2016-06-20 21:21:20 +00:00
|
|
|
asicid = readl(virt);
|
|
|
|
iounmap(virt);
|
2010-12-08 05:37:59 +00:00
|
|
|
|
2016-06-20 21:21:20 +00:00
|
|
|
return asicid;
|
2010-12-08 05:37:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void ux500_print_soc_info(unsigned int asicid)
|
|
|
|
{
|
2016-06-20 21:01:26 +00:00
|
|
|
unsigned int rev = dbx500_id.revision;
|
2010-12-08 05:37:59 +00:00
|
|
|
|
2016-06-20 21:01:26 +00:00
|
|
|
pr_info("DB%4x ", dbx500_id.partnumber);
|
2010-12-08 05:37:59 +00:00
|
|
|
|
|
|
|
if (rev == 0x01)
|
|
|
|
pr_cont("Early Drop");
|
|
|
|
else if (rev >= 0xA0)
|
|
|
|
pr_cont("v%d.%d" , (rev >> 4) - 0xA + 1, rev & 0xf);
|
|
|
|
else
|
|
|
|
pr_cont("Unknown");
|
|
|
|
|
|
|
|
pr_cont(" [%#010x]\n", asicid);
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned int partnumber(unsigned int asicid)
|
|
|
|
{
|
|
|
|
return (asicid >> 8) & 0xffff;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SOC MIDR ASICID ADDRESS ASICID VALUE
|
|
|
|
* DB8500ed 0x410fc090 0x9001FFF4 0x00850001
|
|
|
|
* DB8500v1 0x411fc091 0x9001FFF4 0x008500A0
|
|
|
|
* DB8500v1.1 0x411fc091 0x9001FFF4 0x008500A1
|
|
|
|
* DB8500v2 0x412fc091 0x9001DBF4 0x008500B0
|
2011-12-15 10:08:22 +00:00
|
|
|
* DB8520v2.2 0x412fc091 0x9001DBF4 0x008500B2
|
2010-12-08 05:37:59 +00:00
|
|
|
* DB5500v1 0x412fc091 0x9001FFF4 0x005500A0
|
2012-01-23 10:54:44 +00:00
|
|
|
* DB9540 0x413fc090 0xFFFFDBF4 0x009540xx
|
2010-12-08 05:37:59 +00:00
|
|
|
*/
|
|
|
|
|
2016-06-20 21:21:20 +00:00
|
|
|
static void __init ux500_setup_id(void)
|
2010-12-08 05:37:59 +00:00
|
|
|
{
|
|
|
|
unsigned int cpuid = read_cpuid_id();
|
|
|
|
unsigned int asicid = 0;
|
|
|
|
phys_addr_t addr = 0;
|
|
|
|
|
|
|
|
switch (cpuid) {
|
|
|
|
case 0x410fc090: /* DB8500ed */
|
|
|
|
case 0x411fc091: /* DB8500v1 */
|
|
|
|
addr = 0x9001FFF4;
|
|
|
|
break;
|
|
|
|
|
2011-12-15 10:08:22 +00:00
|
|
|
case 0x412fc091: /* DB8520 / DB8500v2 / DB5500v1 */
|
2010-12-08 05:37:59 +00:00
|
|
|
asicid = ux500_read_asicid(0x9001DBF4);
|
2011-12-15 10:08:22 +00:00
|
|
|
if (partnumber(asicid) == 0x8500 ||
|
|
|
|
partnumber(asicid) == 0x8520)
|
2010-12-08 05:37:59 +00:00
|
|
|
/* DB8500v2 */
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* DB5500v1 */
|
|
|
|
addr = 0x9001FFF4;
|
|
|
|
break;
|
2012-01-23 10:54:44 +00:00
|
|
|
|
|
|
|
case 0x413fc090: /* DB9540 */
|
|
|
|
addr = 0xFFFFDBF4;
|
|
|
|
break;
|
2010-12-08 05:37:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (addr)
|
|
|
|
asicid = ux500_read_asicid(addr);
|
|
|
|
|
|
|
|
if (!asicid) {
|
|
|
|
pr_err("Unable to identify SoC\n");
|
2016-06-20 21:01:26 +00:00
|
|
|
BUG();
|
2010-12-08 05:37:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dbx500_id.process = asicid >> 24;
|
|
|
|
dbx500_id.partnumber = partnumber(asicid);
|
|
|
|
dbx500_id.revision = asicid & 0xff;
|
|
|
|
|
|
|
|
ux500_print_soc_info(asicid);
|
|
|
|
}
|
2016-06-20 21:01:26 +00:00
|
|
|
|
|
|
|
static const char * __init ux500_get_machine(void)
|
|
|
|
{
|
|
|
|
return kasprintf(GFP_KERNEL, "DB%4x", dbx500_id.partnumber);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char * __init ux500_get_family(void)
|
|
|
|
{
|
|
|
|
return kasprintf(GFP_KERNEL, "ux500");
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char * __init ux500_get_revision(void)
|
|
|
|
{
|
|
|
|
unsigned int rev = dbx500_id.revision;
|
|
|
|
|
|
|
|
if (rev == 0x01)
|
|
|
|
return kasprintf(GFP_KERNEL, "%s", "ED");
|
|
|
|
else if (rev >= 0xA0)
|
|
|
|
return kasprintf(GFP_KERNEL, "%d.%d",
|
|
|
|
(rev >> 4) - 0xA + 1, rev & 0xf);
|
|
|
|
|
|
|
|
return kasprintf(GFP_KERNEL, "%s", "Unknown");
|
|
|
|
}
|
|
|
|
|
2020-05-23 17:08:56 +00:00
|
|
|
static ssize_t
|
|
|
|
process_show(struct device *dev, struct device_attribute *attr, char *buf)
|
2016-06-20 21:01:26 +00:00
|
|
|
{
|
|
|
|
if (dbx500_id.process == 0x00)
|
|
|
|
return sprintf(buf, "Standard\n");
|
|
|
|
|
|
|
|
return sprintf(buf, "%02xnm\n", dbx500_id.process);
|
|
|
|
}
|
|
|
|
|
2020-05-23 17:08:56 +00:00
|
|
|
static DEVICE_ATTR_RO(process);
|
|
|
|
|
2020-05-23 17:08:57 +00:00
|
|
|
static struct attribute *ux500_soc_attrs[] = {
|
|
|
|
&dev_attr_process.attr,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
ATTRIBUTE_GROUPS(ux500_soc);
|
|
|
|
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
static const char *db8500_read_soc_id(struct device_node *backupram)
|
2016-06-20 21:01:26 +00:00
|
|
|
{
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
void __iomem *base;
|
2016-06-20 21:01:26 +00:00
|
|
|
const char *retstr;
|
2022-11-08 12:37:55 +00:00
|
|
|
u32 uid[5];
|
2016-06-20 21:01:26 +00:00
|
|
|
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
base = of_iomap(backupram, 0);
|
|
|
|
if (!base)
|
2016-06-20 21:01:26 +00:00
|
|
|
return NULL;
|
2022-11-08 12:37:55 +00:00
|
|
|
memcpy_fromio(uid, base + 0x1fc0, sizeof(uid));
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
|
2016-06-20 21:01:26 +00:00
|
|
|
/* Throw these device-specific numbers into the entropy pool */
|
2022-11-08 12:37:55 +00:00
|
|
|
add_device_randomness(uid, sizeof(uid));
|
2016-06-20 21:01:26 +00:00
|
|
|
retstr = kasprintf(GFP_KERNEL, "%08x%08x%08x%08x%08x",
|
2022-11-08 12:37:55 +00:00
|
|
|
uid[0], uid[1], uid[2], uid[3], uid[4]);
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
iounmap(base);
|
2016-06-20 21:01:26 +00:00
|
|
|
return retstr;
|
|
|
|
}
|
|
|
|
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
static void __init soc_info_populate(struct soc_device_attribute *soc_dev_attr,
|
|
|
|
struct device_node *backupram)
|
2016-06-20 21:01:26 +00:00
|
|
|
{
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
soc_dev_attr->soc_id = db8500_read_soc_id(backupram);
|
2016-06-20 21:01:26 +00:00
|
|
|
soc_dev_attr->machine = ux500_get_machine();
|
|
|
|
soc_dev_attr->family = ux500_get_family();
|
|
|
|
soc_dev_attr->revision = ux500_get_revision();
|
2020-05-23 17:08:57 +00:00
|
|
|
soc_dev_attr->custom_attr_group = ux500_soc_groups[0];
|
2016-06-20 21:01:26 +00:00
|
|
|
}
|
|
|
|
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
static int __init ux500_soc_device_init(void)
|
2016-06-20 21:01:26 +00:00
|
|
|
{
|
|
|
|
struct soc_device *soc_dev;
|
|
|
|
struct soc_device_attribute *soc_dev_attr;
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
struct device_node *backupram;
|
|
|
|
|
|
|
|
backupram = of_find_compatible_node(NULL, NULL, "ste,dbx500-backupram");
|
|
|
|
if (!backupram)
|
|
|
|
return 0;
|
2016-06-20 21:01:26 +00:00
|
|
|
|
2016-06-20 21:21:20 +00:00
|
|
|
ux500_setup_id();
|
|
|
|
|
2016-06-20 21:01:26 +00:00
|
|
|
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
|
2019-04-13 07:14:21 +00:00
|
|
|
if (!soc_dev_attr) {
|
|
|
|
of_node_put(backupram);
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
return -ENOMEM;
|
2019-04-13 07:14:21 +00:00
|
|
|
}
|
2016-06-20 21:01:26 +00:00
|
|
|
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
soc_info_populate(soc_dev_attr, backupram);
|
2019-04-13 07:14:21 +00:00
|
|
|
of_node_put(backupram);
|
2016-06-20 21:01:26 +00:00
|
|
|
|
|
|
|
soc_dev = soc_device_register(soc_dev_attr);
|
|
|
|
if (IS_ERR(soc_dev)) {
|
|
|
|
kfree(soc_dev_attr);
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
return PTR_ERR(soc_dev);
|
2016-06-20 21:01:26 +00:00
|
|
|
}
|
|
|
|
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
return 0;
|
2016-06-20 21:01:26 +00:00
|
|
|
}
|
ARM: ux500: move soc_id driver to drivers/soc
As the ux500 id code is basically a standalone driver, we can move it
out of the arch code into drivers/soc/ux500.
This is a user-visible change, as it moves all the devices in sysfs
from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
separate device.
Originally the idea was to put all on-chip devices under the soc node,
and ux500 was the first platform to have this device, but later platforms
almost all didn't follow that pattern, so this makes the platform do
the same thing as everyone else.
Since the platform is really obsolete now, I am optimistic that nothing
will break after moving the devices around.
As the SoC driver no longer has access to the private header files,
I'm changing the code to instead look up the address of the backupram
from devicetree, which is a good idea anyway.
Finally, having a separate Kconfig symbol means the driver is now
optional and could even be a loadable module rather than always being
built-in if we allowed that for soc_device.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[Fixup mising Makefile, fixup BB_UID_BASE to fc0]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-22 14:32:36 +00:00
|
|
|
subsys_initcall(ux500_soc_device_init);
|