sifive / freedom-metal

Bare Metal Compatibility Library for the Freedom Platform
Other
154 stars 47 forks source link

Add sifive prci support for SiFive HiFive platform #388

Closed zongbox closed 3 years ago

zongbox commented 3 years ago

This driver initializes some necessary PLLs.

zongbox commented 3 years ago

Hi Paul, The register maps doesn't conflict in unleashed and unmatched, I'd like to distinguish the unleashed and unmatched in this driver, then do different initialization. If it is good to you, I would add the implementation above, and keep this original common name for this prci driver. I wanna do the similar thing for freedom-devicetree-tools.

paul-walmsley-sifive commented 3 years ago

Hi Paul, The register maps doesn't conflict in unleashed and unmatched, I'd like to distinguish the unleashed and unmatched in this driver, then do different initialization. If it is good to you, I would add the implementation above, and keep this original common name for this prci driver. I wanna do the similar thing for freedom-devicetree-tools.

Sure, whatever is easiest. It might be easiest to keep them separate, due to limitations in freedom-devicetree-tools. Whatever works for you.

My suggestion about "sifive,unmatched-prci0" was rather stupid, as @e-puerto reminded me. It should be something like "sifive,fu740-c000-prci0" instead. For that to work, the devicetree-overlay-generator will probably need to be modified to rewrite "sifive,ux00prci0" to "sifive,fu740-c000-prci0" if it sees that the SoC is an Almond (e.g., matching on /compatible = "SiFive,FU740-C000" or whatever)

zongbox commented 3 years ago

Changed in v2:

paul-walmsley-sifive commented 3 years ago

Thanks Zong