From d86300cc7e3697f831925ee67ba8936a17c747db Mon Sep 17 00:00:00 2001 From: Usama Arif Date: Fri, 12 Jun 2020 13:45:11 +0100 Subject: [PATCH] Add AMBA bus support to platform devices AMBA specification from Arm is a freely available open standard for the connection and management of functional blocks in a system-on-chip. AMBA devices create a device kernel object in /sys/devices/platform and a kernel object of the bus for the respective device in /sys/bus/amba. For e.g. for pl180 mmc: device: /sys/devices/platform/1c050000.mmci bus: /sys/bus/amba/devices/1c050000.mmci In first stage init, android creates a symlink from /sys/devices/platform/... to /dev/block/platform/... for all partitions and then to /dev/block/by-name for the boot_device used. However this is only done for devices that "attach" to bus/platform. This patch adds support for platform devices that attach to bus/amba. Signed-off-by: Usama Arif Change-Id: I9da7456407c4f62335c959502d8b2d16026fddfc --- init/devices.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/devices.cpp b/init/devices.cpp index 9fbec641b..53ca8751b 100644 --- a/init/devices.cpp +++ b/init/devices.cpp @@ -193,7 +193,8 @@ bool DeviceHandler::FindPlatformDevice(std::string path, std::string* platform_d while (directory != "/" && directory != ".") { std::string subsystem_link_path; if (Realpath(directory + "/subsystem", &subsystem_link_path) && - subsystem_link_path == sysfs_mount_point_ + "/bus/platform") { + (subsystem_link_path == sysfs_mount_point_ + "/bus/platform" || + subsystem_link_path == sysfs_mount_point_ + "/bus/amba")) { // We need to remove the mount point that we added above before returning. directory.erase(0, sysfs_mount_point_.size()); *platform_device_path = directory;