Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

kay54068
Copy link

The atmel-hlcdc PWM driver generates an output frequency that is
exactly half of the value requested in the device tree. For example,
a request for 1000 Hz results in a 500 Hz output.

This is caused by an incorrect prescaler calculation. The driver's
formula for the clock divider did not match the hardware, which uses
a division factor of 2^(pres + 1). The driver was missing the "+1",
causing the output period to be doubled.

This patch corrects the calculation to 2^(pres + 1), aligning it
with the hardware's behavior and ensuring the generated frequency is
correct.

cristibirsan and others added 30 commits April 10, 2025 12:31
MPU updates for linux-6.12-trunk/at91/clk

- clk: at91: sckc: Fix parent_data struct for slow osc (Ryan Wanner 2025-02-05)
- clk: at91: sama7d65: Add missing clk_hw to parent_data (Ryan Wanner 2025-02-06)
- clk: at91: sama7g5: Add missing clk_hw to parent_data (Ryan Wanner 2025-03-20)
MPU updates for linux-6.12-trunk/at91/dt

- ARM: dts: microchip: sama7g5: Adjust clock xtal phandle (Ryan Wanner 2025-03-25)
Add support for the "generic" services on the PolarFire SoC.

The PolarFire SoC system controller is communicated with via a mailbox.
Several of the functions provided by the system controller do not belong
in a specific subsystem, such as reading the fpga device certificate.
These "generic" services all follow the same format:
  - a command + optional payload sent to the sys controller
  - a status + a payload returned to Linux

Add a driver to implement these services and export an interface
as a char device.

Reviewed-by: Daire McNamara <[email protected]>
Signed-off-by: Conor Dooley <[email protected]>
of_match_node() does not increment the refcont of the node pointer, so
there is no need to call of_node_put(). In fact, doing so is actively
wrong, as the accounting is then incorrect and mayb underflow.

Signed-off-by: Conor Dooley <[email protected]>
Use sama7d65 pmc's compatible to lookup for in the SHDWC driver.

Signed-off-by: Ryan Wanner <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Add a driver to support the Polarfire SoC gpio controller. Interrupt
controller support is unavailable for now and will be added at a later
date.

Signed-off-by: Lewis Hanly <[email protected]>
Co-developed-by: Conor Dooley <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Conor Dooley <[email protected]>
coreGPIO, which the "hard" core in PolarFire SoC is based on, has
different offsets for inp/outp. Add some match_data handling to account
for the differences.

Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Conor Dooley <[email protected]>
PIC64GX is compatible as out of order DMA capable, just like
the MPFS version, therefore we add it in compatible with
microchip,mpfs-pdma as fallback

Signed-off-by: Pierre-Henry Moussay <[email protected]>
For PCI and other fabric-based peripherals to function correctly, ranges
properties are required to perform address translation in & out of the
FICs.

Signed-off-by: Conor Dooley <[email protected]>
For PCI and other fabric-based peripherals to function correctly, ranges
properties are required to perform address translation in & out of the
FICs.

Signed-off-by: Conor Dooley <[email protected]>
The SEV kit has a custom video pipeline in the FPGA fabric, supported by
the dscmi media driver. Add the description of this pipeline to the FPGA
fabric's dtsi file.

Signed-off-by: Conor Dooley <[email protected]>
The sev kit was missing both it's ranges properties, and the "no-map"
properties for it's reserved memory sections. Add them.

Signed-off-by: Conor Dooley <[email protected]>
Some of the clint and plic interrupts are not relevant to s-mode
software, like Linux. Mask them off in the devicetree.

Signed-off-by: Conor Dooley <[email protected]>
There should be a space between entries. Add it.

Signed-off-by: Conor Dooley <[email protected]>
Update the fabric content to match the v2023.02 IKRD.

Signed-off-by: Conor Dooley <[email protected]>
Add some top level cells to denote the platform as 64-bit.

Signed-off-by: Conor Dooley <[email protected]>
As per the v2022.10/v2023.02 IKRD, add overlaid memory map required to
support non-coherent DMA.

Signed-off-by: Conor Dooley <[email protected]>
At the request of Canonical, the upstream dts has USB in host mode, but
switch our downstream kernel to use otg mode to match 5.15.

Signed-off-by: Conor Dooley <[email protected]>
Import the AMP dts from 5.15 to ~6.1~ 6.6

Signed-off-by: Conor Dooley <[email protected]>
These didn't get added during upstreaming, add them here.

Signed-off-by: Conor Dooley <[email protected]>
As of the v2022.10 IKRD, many peripherals are no longer dma-coherent.
Annotate them as such in the devicetree as appropriate.

Signed-off-by: Conor Dooley <[email protected]>
update link frequency 445500000 of 1920x1080 in sevkit dts imx334 node

Signed-off-by: Shravan Chippa <[email protected]>
Copying directly from the Icicle, add the SEVKIT's QSPI nor flash to the
devicetree so that it can be used to store Auto Upgrade images.

Signed-off-by: Conor Dooley <[email protected]>
On Microchip PolarFire SoC, it can be more effective to partition
DDR into cached and non-cached memory and to reserve the non-cached
memory. update dma-ranges property

Signed-off-by: Shravan Chippa <[email protected]>
The single cell causes a warning during the sensehat joystick probe as it
expects an IRQ two cell binding. Change the gpio interrupt cells from single
cell to two cell to support the update of the Raspberry Pi Sensehat device tree
overlay for the update to the v6.1 kernel.

Signed-off-by: Jamie Gibbons <[email protected]>
The official name of "PolarFire SoC sev kit" has changed to
"PolarFire SoC Video Kit", so add new compatible
"microchip,mpfs-video-kit".

Signed-off-by: Vattipalli Praveen <[email protected]>
Signed-off-by: Conor Dooley <[email protected]>
The official name of "PolarFire SoC sev kit" has changed to
"PolarFire SoC Video Kit", so rename "mpfs-sev-kit.dts" to
mpfs-video-kit.dts and "mpfs-sev-kit-fabric.dtsi" to
"mpfs-video-kit-fabric.dtsi".

Signed-off-by: Vattipalli Praveen <[email protected]>
Signed-off-by: Conor Dooley <[email protected]>
…sion H.264 IP

A separate register is added so that the OSD will get disabled
in the hardware itself, so added compatible.

Signed-off-by: Vattipalli Praveen <[email protected]>
… dynamic contents from overlays

Remove preset video pipeline and add fabric bus node in the device tree
with a label. All fabric content will be dynamically added, depending on
the selected IPs, using dt-overlays.

Signed-off-by: Shravan Chippa <[email protected]>
[conor: rewrote some commit message bits]
Signed-off-by: Conor Dooley <[email protected]>
cristibirsan and others added 29 commits June 20, 2025 17:17
FPGA wdt updates for 250619

* watchdog: microchip: Add support for MPFS WDT (Daire McNamara 2025-05-20)
* dt-bindings: watchdog: microchip: Add bindings for MPFS Watchdogs (Daire McNamara 2025-05-20)

Signed-off-by: Conor Dooley <[email protected]>
FPGA serial updates for 250619

* tty: serial: Add support for COREUART driver (prashanth kumar burujukindi 2025-05-01)
* dt-bindings: serial: Add Microchip CoreUART binding (prashanth kumar burujukindi 2025-05-01)

Signed-off-by: Conor Dooley <[email protected]>
FPGA dma updates for 250619

* dt-bindings: dma: document the microchip fpga soft dma controller (Conor Dooley 2022-05-17)
* dt-bindings: dma: sifive pdma: Add PIC64GX to compatibles (Pierre-Henry Moussay 2024-06-24)

Signed-off-by: Conor Dooley <[email protected]>
FPGA mailbox updates for 250619

* mailbox: add Microchip IPC support (Valentina Fernandez 2024-12-17)
* dt-bindings: mailbox: add binding for Microchip IPC mailbox controller (Valentina Fernandez 2024-12-17)
* riscv: export __cpuid_to_hartid_map (Valentina Fernandez 2024-12-17)
* riscv: sbi: vendorid_list: Add Microchip Technology to the vendor list (Valentina Fernandez 2024-12-17)
* dt-bindings: mbox: add PIC64GX mailbox compatibility to MPFS mailbox (Pierre-Henry Moussay 2024-06-24)
* mailbox: mpfs: support new, syscon based, devicetree configuration (Conor Dooley 2024-10-02)
* dt-bindings: mailbox: mpfs: fix reg properties (Conor Dooley 2024-08-07)
* dt-bindings: mailbox: miv-ihc: remove redundant quotes causing warnings (Conor Dooley 2024-05-20)
* mbox: add mi-v ihc support (Valentina Fernandez 2022-05-09)
* dt-bindings: mailbox: add binding for miv-ihc (Valentina Fernandez 2022-05-09)

Signed-off-by: Conor Dooley <[email protected]>
FPGA remoteproc updates for 250619

* remoteproc: add support for Microchip IPC remoteproc platform driver (Valentina Fernandez 2024-06-12)
* of: reserved_mem: add support for looking up of memory regions by name (Valentina Fernandez 2025-05-01)
* dt-bindings: remoteproc: add Microchip IPC remoteproc (Valentina Fernandez 2024-06-12)
* remoteproc: add support for Microchip Mi-V remoteproc platform driver (Valentina Fernandez 2022-09-16)
* dt-bindings: remoteproc: add binding for miv-remoteproc (Valentina Fernandez 2022-09-16)

Signed-off-by: Conor Dooley <[email protected]>
FPGA misc updates for 250619

* misc: add mchp dma proxy driver (Shravan Chippa 2022-09-08)
* dt-bindings: misc: microchip,mpfs-dma-proxy (Shravan Chippa 2022-09-08)

Signed-off-by: Conor Dooley <[email protected]>
FPGA config updates for 250619

* RISC-V: configs: add mpfs_defconfig (Conor Dooley 2025-04-14)

Signed-off-by: Conor Dooley <[email protected]>
FPGA sensehat updates for 250619

* auxdisplay: sensehat: move to remove callback returning void (Conor Dooley 2025-04-03)
* MAINTAINERS: Add sensehat driver authors to MAINTAINERS (Charles Mirabile 2022-08-23)
* dt-bindings: mfd: sensehat: Add Raspberry Pi Sense HAT schema (Charles Mirabile 2022-08-23)
* drivers/auxdisplay: sensehat: Raspberry Pi Sense HAT display driver (Charles Mirabile 2022-08-23)
* drivers/mfd: sensehat: Add Raspberry Pi Sense HAT to simple_mfd_i2c (Charles Mirabile 2022-08-23)

Signed-off-by: Conor Dooley <[email protected]>
FPGA dt updates for 250624

* riscv: dts: microchip: add icicle kit with prod device (MPFS250T) (Valentina Fernandez 2025-06-04)
* dt-bindings: riscv: microchip: document icicle kit with prod device (Conor Dooley 2025-06-04)
* riscv: dts: microchip: add watchdog devices (Daire McNamara 2025-05-20)
* riscv: dts: microchip: drop simple-mfd from control-scb syscon (Conor Dooley 2025-05-13)
* riscv: dts: microchip: pic64gx: fix pdma fallback compatible (Conor Dooley 2025-05-13)
* riscv: dts: microchip: pic64gx: fix reg/unit address mismatches (Conor Dooley 2025-05-13)
* riscv: dts: microchip: enable south-west corner CCC on disco kit (Valentina Fernandez 2025-05-08)
* riscv: dts: microchip: update ihc and rproc nodes to use ipc driver (Valentina Fernandez 2025-05-01)
* riscv: dts: microchip: Add CoreUART nodes for PolarFire SoC (prashanth kumar burujukindi 2025-05-01)
* riscv: dts: microchip: add missing header to beaglev (Conor Dooley 2025-04-14)
* risv: dts: microchip: add mmc0 and mmc1 aliases on BeagleV Fire (Valentina Fernandez 2025-03-19)
* dts: microchip: pic64gx-curiosity-kit: add video capture pipeline (Shravan Chippa 2025-01-31)
* riscv: dts: microchip: remove sd-card gpio hogs from beagle (Conor Dooley 2024-11-05)
* riscv: dts: microchip: fix mmc-spi-slot node name (Conor Dooley 2024-10-03)
* riscv: dts: microchip: update plic and clint node for PIC64GX (Pierre-Henry Moussay 2024-09-27)
* riscv: dts: microchip: fix clock node naming (Pierre-Henry Moussay 2024-09-27)
* dt-bindings: interrupt-controller: sifive,plic: Add PIC64GX compatibility (Pierre-Henry Moussay 2024-09-27)
* dt-bindings: timer: sifive,clint: add PIC64GX compatibility (Pierre-Henry Moussay 2024-09-27)
* riscv: dts: microchip: pic64gx: remove microchip,pic64gx-sys-controller fallback (Pierre-Henry Moussay 2024-10-02)
* dt-bindings: riscv: microchip: document the PIC64GX curiosity kit (Pierre-Henry Moussay 2024-06-24)
* riscv: dts: microchip: add PIC64GX Curiosity Kit dts (Pierre-Henry Moussay 2024-06-24)
* riscv: dts: microchip: move irq mux to a syscon subdev (Conor Dooley 2024-08-19)
* riscv: dts: microchip: convert clock and reset to use syscon (Conor Dooley 2024-08-19)
* riscv: dts: microchip: fix mailbox description (Conor Dooley 2024-08-08)
* riscv: dts: microchip: enable qspi adc/mmc-spi-slot on BeagleV Fire (Conor Dooley 2024-05-13)
* riscv: dts: microchip: drop Icicle Kit AMP device tree (Valentina Fernandez 2024-07-29)
* riscv: dts: microchip: reduce hss buffer size in the mpfs disco kit dts (Valentina Fernandez 2024-06-28)
* riscv: dts: microchip: use miv-ihc mailbox IP in mpfs disco kit (Valentina Fernandez 2024-06-26)
* Revert "riscv: dts: microchip: update ihc and rproc nodes to use ipc driver" (Valentina Fernandez 2024-06-26)
* Revert "riscv: dts: microchip: update ihc node in beaglev-fire dts" (Valentina Fernandez 2024-06-26)
* riscv: dts: microchip: fixes to ihc node interrupts and interrupt-names (Valentina Fernandez 2024-06-20)
* riscv: dts: microchip: fix pci node addresses on m100pfs and polarberry (Conor Dooley 2024-06-20)
* riscv: dts: microchip: update ihc node in beaglev-fire dts (Valentina Fernandez 2024-06-20)
* riscv: dts: microchip: enable missing fabric peripherals in disco kit (Valentina Fernandez 2024-06-19)
* riscv: dts: microchip: enable missing peripherals in disco kit dts (Valentina Fernandez 2024-06-17)
* riscv: dts: microchip: update ihc and rproc nodes to use ipc driver (Valentina Fernandez 2024-06-12)
* dt-bindings: riscv: microchip: document icicle reference design v202406 (Valentina Fernandez 2024-06-12)
* riscv: dts: microchip: BeagleV Fire uses PCIe instance 0 (Conor Dooley 2024-06-05)
* riscv: dts: microchip: update pci regs to split bridge/ctrl regions (Conor Dooley 2024-04-25)
* riscv: dts: microchip: define only one default dma region (Conor Dooley 2024-05-23)
* riscv: dts: microchip: fix disco kit phy node address warnings (Conor Dooley 2024-05-20)
* riscv: dts: microchip: fix discokit stdout path (Conor Dooley 2024-04-16)
* riscv: dts: microchip: add mac0 to mpfs-disco-kit dts (Valentina Fernandez 2024-04-04)
* riscv: dts: microchip: add mpfs dma proxy in mpfs-disco-kit dts (Valentina Fernandez 2024-03-28)
* riscv: dts: microchip: add lsram and fabric dma to mpfs-disco-kit dts (Valentina Fernandez 2024-03-27)
* riscv: dts: microchip: fixup some outstanding mixed leading indent (Conor Dooley 2024-03-28)
* riscv: dts: microchip: convert spaces to tabs for the discokit (Conor Dooley 2024-03-20)
* riscv: dts: microchip: fix disco kit memory map (Pierre-Henry Moussay 2024-03-20)
* riscv: dts: microchip: remove spidev from m100pfsevp devicetree (Conor Dooley 2024-04-25)
* riscv: dts: microchip: add mpfs-disco-kit dts (Pierre-Henry Moussay 2024-02-14)
* dt-bindings: riscv: microchip: document the mpfs disco kit (Pierre-Henry Moussay 2024-02-14)
* riscv: dts: microchip: enable the second CAN interface in the amp dts (Valentina Fernandez 2024-02-16)
* riscv: dts: microchip: add missing properties for fabric-bus 4 (Conor Dooley 2024-01-26)
* riscv: dts: microchip: fix node name for fabric-bus4 (Conor Dooley 2024-01-26)
* dt-bindings: riscv: microchip: fix video-kit compatible fallbacks (Conor Dooley 2024-01-26)
* riscv: dts: microchip: enable the second CAN interface (Naga Sureshkumar Relli 2024-01-24)
* riscv: dts: microchip: Add crypto node for video kit (Padmarao Begari 2023-12-20)
* riscv: dts: microchip: add resets to the MSS CAN (Naga Sureshkumar Relli 2024-01-23)
* riscv: dts: microchip: mpfs: m100pfsevp: re-add dts for emmc and sdcard (Wolfgang Grandegger 2023-07-06)
* riscv: dts: microchip: update gpio interrupts to better match the SoC (Conor Dooley 2023-10-09)
* riscv: dts: microchip: mpfs-video-kit: remove fabric nodes to support dynamic contents from overlays (Shravan Chippa 2023-08-16)
* riscv: dts: microchip: video-kit: Add separate compatible for new version H.264 IP (Vattipalli Praveen 2023-07-11)
* riscv: dts: microchip: Rename all references of "PolarFire SoC SEV Kit" (Vattipalli Praveen 2023-05-19)
* dt-bindings: riscv: microchip: add mpfs video kit (Vattipalli Praveen 2023-05-19)
* riscv: dts: microchip: mpfs: update gpio interrupt cells (Jamie Gibbons 2023-05-16)
* riscv: dts: microchip: update reserve non-cached addresses on sev-kit (Shravan Chippa 2023-04-06)
* riscv: dts: microchip: add the sevkit's system controller spi flash (Conor Dooley 2023-04-17)
* riscv: dts: microchip: sev-kit: update imx334 node (Shravan Chippa 2023-04-03)
* riscv: dts: microchip: annotate icicle peripherals with dma-noncoherent (Conor Dooley 2023-03-16)
* riscv: dts: microchip: add missed items from upstreaming (Conor Dooley 2023-03-16)
* riscv: dts: microchip: add a dts for amp on icicle kit (Conor Dooley 2023-03-16)
* riscv: dts: microchip: switch the icicle's usb to otg mode (Conor Dooley 2023-03-16)
* riscv: dts: microchip: add overlaid memory to icicle kit (Conor Dooley 2023-03-16)
* riscv: dts: microchip: add top level address/size cells to icicle (Conor Dooley 2023-03-16)
* riscv: dts: microchip: update the icicle's fabric content (Conor Dooley 2023-03-16)
* riscv: dts: microchip: add a missing space to the mpfs musb entry (Conor Dooley 2023-03-16)
* riscv: dts: microchip: mask off some mmode interrupts (Conor Dooley 2023-03-16)
* riscv: dts: microchip: fixup the sev kit's reserved memory configuration (Conor Dooley 2023-03-16)
* riscv: dts: microchip: add the sev kit's video pipeline (Conor Dooley 2023-03-16)
* riscv: dts: microchip: add ranges to polarberry's fabric (Conor Dooley 2023-03-16)
* riscv: dts: microchip: add ranges to m100pfs' fabric (Conor Dooley 2023-03-16)

Signed-off-by: Conor Dooley <[email protected]>
…bus_xfer()

mchp_corei2c_xfer() returns negative errnos, checking if (ret) will
erroneously trigger when a valid zero is returned.

Signed-off-by: Conor Dooley <[email protected]>
When probe fails, mpfs_dma_proxy_cleanup_channels() is called to clean
up after the driver. mpfs_dma_proxy_cleanup_channels() in turn calls
mpfs_dma_proxy_cdevice_exit() which calls class_destory() when
the active_channels member of the mpfs_dma_proxy struct corresponding to
the instance is 1 (IOW when this is hte last remaining active channel).

However, the driver never initialises active_channels to zero before
incrementing it, causing class_destroy to be called at incorrect times.
Switch a devm_kmalloc() for a devm_kzalloc() in probe to ensure
active_channels is zeroed prior to use.

Signed-off-by: Conor Dooley <[email protected]>
To facilitate using content from this driver as a basis for a
Zephyr one, dual license it with BSD-2-Clause.

Signed-off-by: Conor Dooley <[email protected]>
Microchip PolarFire SoC and PIC64GX feature five watchdogs, one
associated with each hart. This patch enables four watchdogs,
corresponding to the four harts that are enabled in the device trees.

Signed-off-by: Valentina Fernandez <[email protected]>
Microchip PIC64GX features five watchdogs, one associated
with each hart. This patch describes these watchdog devices and enables
four watchdogs, corresponding to the four harts that are enabled in the
PIC64GX Curiosity Kit device tree.

Signed-off-by: Valentina Fernandez <[email protected]>
FPGA can updates for 250703

* net: can: mpfs: dual license with BSD-2-Clause (Conor Dooley 2025-07-01)

Signed-off-by: Conor Dooley <[email protected]>
FPGA i2c updates for 250703

* i2c: microchip-core: fix mchp_corei2c_xfer() check in mchp_corei2c_smbus_xfer() (Conor Dooley 2025-06-26)

Signed-off-by: Conor Dooley <[email protected]>
FPGA misc updates for 250703

* misc: mpfs-dma-proxy: zero-initialise dma_proxy in probe (Conor Dooley 2025-06-30)

Signed-off-by: Conor Dooley <[email protected]>
The dma-noncoherent parts of the BeagleV Fire dts never went upstream,
and got lost in the rebase process. Add back the missing pieces.

Signed-off-by: Conor Dooley <[email protected]>
FPGA dt updates for 250710

* riscv: dts: microchip: add content lost in 6.6 -> 6.12 rebase (Conor Dooley 2025-07-09)
* riscv: dts: microchip: add watchdog devices to PIC64GX (Valentina Fernandez 2025-07-03)
* riscv: dts: microchip: enable watchdogs in all PolarFire SoC eval boards (Valentina Fernandez 2025-07-03)

Signed-off-by: Conor Dooley <[email protected]>
The PolarFire SoC Discovery Kit includes a CoreUART IP instance in the
FPGA reference design. Update the Discovery Kit device tree to reflect
this.

Signed-off-by: Valentina Fernandez <[email protected]>
Commit 98c3710 enabled all five watchdog timers on PolarFire SoC and
PIC64GX evaluation boards. However, enabling a single watchdog is
sufficient, as the kernel already provides  soft and hard lockup
detection via CONFIG_LOCKUP_DETECTOR and CONFIG_SOFTLOCKUP_DETECTOR.

Signed-off-by: Valentina Fernandez <[email protected]>
Enable CONFIG_SERIAL_MICROCHIP_COREUART in mpfs_defconfig to add
support for the coreUART IP available in the Libero catalog.

Signed-off-by: Valentina Fernandez <[email protected]>
FPGA dt updates for 250718

* riscv: dts: microchip: enable a single watchdog (wdt1) only (Valentina Fernandez 2025-07-14)
* riscv: dts: microchip: add coreUART to Discovery Kit dts (Valentina Fernandez 2025-07-11)

Signed-off-by: Conor Dooley <[email protected]>
FPGA config updates for 250718

* RISC-V: configs: add Microchip coreUART to mpfs_defconfig (Valentina Fernandez 2025-07-11)

Signed-off-by: Conor Dooley <[email protected]>
REFCLK can be provided by an external source so this should be exposed
by a DT property. The REFCLK is used for RMII and in some SoCs that use
this driver the RGMII 125MHz clk can also be provided by an external
source.

Signed-off-by: Ryan Wanner <[email protected]>
Acked-by: Conor Dooley <[email protected]>
The RMII and RGMII can both support internal or external provided
REFCLKs 50MHz and 125MHz respectively. Since this is dependent on
the board that the SoC is on this needs to be set via the device tree.

This property flag is checked in the MACB DT node so the REFCLK cap is
configured the correct way for the RMII or RGMII is configured on the
board.

Signed-off-by: Ryan Wanner <[email protected]>
This macro enables the RMII mode bit in the USRIO register when RMII
mode is requested.

Signed-off-by: Ryan Wanner <[email protected]>
MPU updates for linux-6.12-trunk/at91/net

- dt-bindings: net: cdns,macb: Add external REFCLK property (Ryan Wanner 2025-06-11)
- net: cadence: macb: Expose REFCLK as a device tree property (Ryan Wanner 2025-06-19)
- net: cadence: macb: Enable RMII for SAMA7 gem (Ryan Wanner 2025-06-19)
The atmel-hlcdc PWM driver generates an output frequency that is
exactly half of the value requested in the device tree. For example,
a request for 1000 Hz results in a 500 Hz output.

This is caused by an incorrect prescaler calculation. The driver's
formula for the clock divider did not match the hardware, which uses
a division factor of 2^(pres + 1). The driver was missing the "+1",
causing the output period to be doubled.

This patch corrects the calculation to `2^(pres + 1)`, aligning it
with the hardware's behavior and ensuring the generated frequency is
correct.
@kay54068 kay54068 closed this Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.