From 77e97abf129c5028385dd72587eabab68db0d954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 28 May 2020 19:08:55 +0200 Subject: bcm27xx: update to latest patches from RPi foundation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also removes random module and switches to new bcm2711 thermal driver. Boot tested on RPi 4B v1.1 4G. Signed-off-by: Álvaro Fernández Rojas --- ...-Pass-the-clocks-data-to-the-firmware-fun.patch | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 target/linux/bcm27xx/patches-5.4/950-0526-clk-bcm-rpi-Pass-the-clocks-data-to-the-firmware-fun.patch (limited to 'target/linux/bcm27xx/patches-5.4/950-0526-clk-bcm-rpi-Pass-the-clocks-data-to-the-firmware-fun.patch') diff --git a/target/linux/bcm27xx/patches-5.4/950-0526-clk-bcm-rpi-Pass-the-clocks-data-to-the-firmware-fun.patch b/target/linux/bcm27xx/patches-5.4/950-0526-clk-bcm-rpi-Pass-the-clocks-data-to-the-firmware-fun.patch new file mode 100644 index 0000000000..7822ff0d11 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.4/950-0526-clk-bcm-rpi-Pass-the-clocks-data-to-the-firmware-fun.patch @@ -0,0 +1,96 @@ +From 1231dbeb8bfeda68c53854cc68016acd74665079 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Fri, 7 Feb 2020 16:08:17 +0100 +Subject: [PATCH] clk: bcm: rpi: Pass the clocks data to the firmware + function + +The raspberry_clock_property only takes the clock ID as an argument, but +now that we have a clock data structure it makes more sense to just pass +that structure instead. + +Cc: Michael Turquette +Cc: Stephen Boyd +Cc: linux-clk@vger.kernel.org +Acked-by: Nicolas Saenz Julienne +Signed-off-by: Maxime Ripard +--- + drivers/clk/bcm/clk-raspberrypi.c | 29 ++++++++++++++--------------- + 1 file changed, 14 insertions(+), 15 deletions(-) + +--- a/drivers/clk/bcm/clk-raspberrypi.c ++++ b/drivers/clk/bcm/clk-raspberrypi.c +@@ -67,11 +67,12 @@ struct raspberrypi_firmware_prop { + __le32 disable_turbo; + } __packed; + +-static int raspberrypi_clock_property(struct rpi_firmware *firmware, u32 tag, +- u32 clk, u32 *val) ++static int raspberrypi_clock_property(struct rpi_firmware *firmware, ++ const struct raspberrypi_clk_data *data, ++ u32 tag, u32 *val) + { + struct raspberrypi_firmware_prop msg = { +- .id = cpu_to_le32(clk), ++ .id = cpu_to_le32(data->id), + .val = cpu_to_le32(*val), + .disable_turbo = cpu_to_le32(1), + }; +@@ -94,9 +95,8 @@ static int raspberrypi_fw_pll_is_on(stru + u32 val = 0; + int ret; + +- ret = raspberrypi_clock_property(rpi->firmware, +- RPI_FIRMWARE_GET_CLOCK_STATE, +- data->id, &val); ++ ret = raspberrypi_clock_property(rpi->firmware, data, ++ RPI_FIRMWARE_GET_CLOCK_STATE, &val); + if (ret) + return 0; + +@@ -113,9 +113,8 @@ static unsigned long raspberrypi_fw_pll_ + u32 val = 0; + int ret; + +- ret = raspberrypi_clock_property(rpi->firmware, +- RPI_FIRMWARE_GET_CLOCK_RATE, +- data->id, &val); ++ ret = raspberrypi_clock_property(rpi->firmware, data, ++ RPI_FIRMWARE_GET_CLOCK_RATE, &val); + if (ret) + return ret; + +@@ -131,9 +130,9 @@ static int raspberrypi_fw_pll_set_rate(s + u32 new_rate = rate / RPI_FIRMWARE_PLLB_ARM_DIV_RATE; + int ret; + +- ret = raspberrypi_clock_property(rpi->firmware, ++ ret = raspberrypi_clock_property(rpi->firmware, data, + RPI_FIRMWARE_SET_CLOCK_RATE, +- data->id, &new_rate); ++ &new_rate); + if (ret) + dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d", + clk_hw_get_name(hw), ret); +@@ -198,18 +197,18 @@ static int raspberrypi_register_pllb(str + init.flags = CLK_GET_RATE_NOCACHE | CLK_IGNORE_UNUSED; + + /* Get min & max rates set by the firmware */ +- ret = raspberrypi_clock_property(rpi->firmware, ++ ret = raspberrypi_clock_property(rpi->firmware, data, + RPI_FIRMWARE_GET_MIN_CLOCK_RATE, +- data->id, &min_rate); ++ &min_rate); + if (ret) { + dev_err(rpi->dev, "Failed to get %s min freq: %d\n", + init.name, ret); + return ret; + } + +- ret = raspberrypi_clock_property(rpi->firmware, ++ ret = raspberrypi_clock_property(rpi->firmware, data, + RPI_FIRMWARE_GET_MAX_CLOCK_RATE, +- data->id, &max_rate); ++ &max_rate); + if (ret) { + dev_err(rpi->dev, "Failed to get %s max freq: %d\n", + init.name, ret); -- cgit v1.2.3