Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onl: allow building more platforms #147

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 434a7cbd5d0f41bbce895b5ff5740f626e4d4771 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@bisdn.de>
Date: Tue, 23 Feb 2021 20:24:26 +0100
Subject: [PATCH 1/10] accton-as4610: fix buffer overflow while accessing led
Subject: [PATCH 1/8] accton-as4610: fix buffer overflow while accessing led
states

The led bridgeness path is constructed of a prefix
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a24a53d0080505b97b78302fc09fac5621589346 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@bisdn.de>
Date: Mon, 19 Apr 2021 16:52:16 +0200
Subject: [PATCH 2/10] accton-as4610: fix value truncation when accessing leds
Subject: [PATCH 2/8] accton-as4610: fix value truncation when accessing leds

Some leds, namely PSU1/2 and FAN support the mode
LED_MODE_AUTO_BLINKING. This mode has the numeric value of 10, which
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 53461bbe1947891cac882033959434553d8343a9 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@bisdn.de>
Date: Tue, 17 May 2022 10:22:52 +0200
Subject: [PATCH 3/10] accton-as4610: do not try to read out PSU values for YM-1921
Subject: [PATCH 3/8] accton-as4610: do not try to read out PSU values for YM-1921

Reading PSU output values on YM-1921 seems to be unreliable and can
lockup the I2C bus, which causes system hangs and ultimately resets by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 7ae57ab6d3ab2d8df54f50d8ef2e8f59e6b13ed4 Mon Sep 17 00:00:00 2001
From 015a60ac275f5dbd658523389ed23f754b96bcab Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@bisdn.de>
Date: Fri, 26 Aug 2022 12:09:49 +0200
Subject: [PATCH 4/10] accton_as4610_cpld: add of device match table
Subject: [PATCH 4/8] accton_as4610_cpld: add of device match table

For on-demand loading to work the kernel needs to know which compatibles
are handled by the driver, so add an appropriate table.
Expand All @@ -13,7 +13,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
1 file changed, 8 insertions(+)

diff --git a/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_cpld.c b/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_cpld.c
index 2ee2d1631095..69645c4df148 100644
index db5a70f234eb..c327f54ff0bd 100644
--- a/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_cpld.c
+++ b/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_cpld.c
@@ -33,6 +33,7 @@
Expand All @@ -37,14 +37,14 @@ index 2ee2d1631095..69645c4df148 100644
#define TRANSCEIVER_PRESENT_ATTR_ID(index) MODULE_PRESENT_##index
#define TRANSCEIVER_TXDISABLE_ATTR_ID(index) MODULE_TXDISABLE_##index
#define TRANSCEIVER_RXLOS_ATTR_ID(index) MODULE_RXLOS_##index
@@ -601,6 +608,7 @@ static struct i2c_driver as4610_54_cpld_driver = {
@@ -607,6 +614,7 @@ static struct i2c_driver as4610_54_cpld_driver = {
.driver = {
.name = "as4610_54_cpld",
.owner = THIS_MODULE,
+ .of_match_table = as4610_54_cpld_of_id,
},
.probe = as4610_54_cpld_probe,
.remove = as4610_54_cpld_remove,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
--
2.42.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8ce7773513d851f609e486ce844690940243da2b Mon Sep 17 00:00:00 2001
From 5b3121fb3b6e122f04b8411485dbc3e240342d63 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@bisdn.de>
Date: Fri, 26 Aug 2022 12:10:23 +0200
Subject: [PATCH 5/10] accton_as4610_psu: add of device match table
Subject: [PATCH 5/8] accton_as4610_psu: add of device match table

For on-demand loading to work the kernel needs to know which compatibles
are handled by the driver, so add an appropriate table.
Expand All @@ -13,18 +13,18 @@ Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
1 file changed, 9 insertions(+)

diff --git a/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_psu.c b/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_psu.c
index 9a579e79aec9..c29b9350ee7f 100644
index 0ad218228f7f..ec3c75a51153 100644
--- a/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_psu.c
+++ b/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_psu.c
@@ -33,6 +33,7 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/dmi.h>
+#include <linux/of.h>
#include <linux/version.h>

#define MAX_MODEL_NAME 11
#define MAX_SERIAL_NUMBER 18
@@ -204,10 +205,18 @@ static const struct i2c_device_id as4610_psu_id[] = {
@@ -210,10 +211,18 @@ static const struct i2c_device_id as4610_psu_id[] = {
};
MODULE_DEVICE_TABLE(i2c, as4610_psu_id);

Expand All @@ -42,7 +42,7 @@ index 9a579e79aec9..c29b9350ee7f 100644
+ .of_match_table = as4610_psu_of_id,
},
.probe = as4610_psu_probe,
.remove = as4610_psu_remove,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
--
2.42.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 48c8d336dd30ca23698beaf68032ee53e384876b Mon Sep 17 00:00:00 2001
From 5bb41a44a0bdda148d5c9cf5959ba824c6c66c75 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@bisdn.de>
Date: Fri, 26 Aug 2022 12:22:19 +0200
Subject: [PATCH 6/10] accton-as4610: let CPLD handle the FAN device
Subject: [PATCH 6/8] accton-as4610: let CPLD handle the FAN device

The FAN device directly depends on the CPLD device, so let it be created
by the CPLD driver. This allows us to convert the FAN driver to a simple
Expand All @@ -18,7 +18,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
2 files changed, 42 insertions(+), 71 deletions(-)

diff --git a/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_cpld.c b/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_cpld.c
index 69645c4df148..ed36e041e7f0 100644
index c327f54ff0bd..d97b0f42a961 100644
--- a/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_cpld.c
+++ b/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_cpld.c
@@ -34,6 +34,7 @@
Expand Down Expand Up @@ -86,7 +86,7 @@ index 69645c4df148..ed36e041e7f0 100644

/* Remove sysfs hooks */
diff --git a/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_fan.c b/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_fan.c
index 9b134e56922d..2e14798a9721 100644
index fe78e0440eb3..74ff7fd68530 100644
--- a/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_fan.c
+++ b/packages/platforms/accton/armxx/arm-accton-as4610/modules/accton_as4610_fan.c
@@ -255,11 +255,19 @@ static int as4610_fan_probe(struct platform_device *pdev)
Expand All @@ -110,8 +110,8 @@ index 9b134e56922d..2e14798a9721 100644
+ goto exit_free;
}

fan_data->hwmon_dev = hwmon_device_register_with_info(&pdev->dev, "as4610_fan",
@@ -275,6 +283,8 @@ static int as4610_fan_probe(struct platform_device *pdev)
fan_data->hwmon_dev = hwmon_device_register(&pdev->dev);
@@ -274,6 +282,8 @@ static int as4610_fan_probe(struct platform_device *pdev)

exit_remove:
sysfs_remove_group(&pdev->dev.kobj, &as4610_fan_group);
Expand All @@ -120,7 +120,7 @@ index 9b134e56922d..2e14798a9721 100644
exit:
return status;
}
@@ -284,6 +294,8 @@ static int as4610_fan_remove(struct platform_device *pdev)
@@ -283,6 +293,8 @@ static int as4610_fan_remove(struct platform_device *pdev)
hwmon_device_unregister(fan_data->hwmon_dev);
sysfs_remove_group(&pdev->dev.kobj, &as4610_fan_group);

Expand All @@ -129,7 +129,7 @@ index 9b134e56922d..2e14798a9721 100644
return 0;
}

@@ -302,75 +314,7 @@ static struct platform_driver as4610_fan_driver = {
@@ -301,75 +313,7 @@ static struct platform_driver as4610_fan_driver = {
},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 242f9ae241b1917cab412c3decc6bfc3c18f6a55 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@bisdn.de>
Date: Fri, 26 Aug 2022 14:16:09 +0200
Subject: [PATCH 7/10] accton-as4610: fix FAN driver id table
Subject: [PATCH 7/8] accton-as4610: fix FAN driver id table

This is a platform driver, not an I2C driver, so fix and add the id
table to the driver.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From aa73d83e6046d67680774c4ced8d4ea7e2790cfa Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@bisdn.de>
Date: Fri, 26 Aug 2022 14:26:51 +0200
Subject: [PATCH 8/10] accton-as4610: let CPLD handle the LED device
Subject: [PATCH 8/8] accton-as4610: let CPLD handle the LED device

The LED device directly depends on the CPLD device, so let it be created
by the CPLD driver. This allows us to convert the LED driver to a simple
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1a1ae46290b3b1cff0fd40a86ff9d0103140b65d Mon Sep 17 00:00:00 2001
From: Rubens Figueiredo <rubens.figueiredo@bisdn.de>
Date: Thu, 25 Nov 2021 14:55:51 +0100
Subject: [PATCH 2/3] accton-as4630-54pe: Avoid undefined behaviour
Subject: [PATCH] accton-as4630-54pe: Avoid undefined behaviour

memsetting a null pointer is undefined behaviour. This causes gcc to
assume that a variable is non null for execution and compiles away all
Expand Down
Loading