
-----Original Message----- From: Jagan Teki jagan@amarulasolutions.com Sent: 10 May 2020 14:34 To: Pragnesh Patel pragnesh.patel@sifive.com Cc: U-Boot-Denx u-boot@lists.denx.de; Atish Patra atish.patra@wdc.com; Palmer Dabbelt palmerdabbelt@google.com; Bin Meng bmeng.cn@gmail.com; Paul Walmsley paul.walmsley@sifive.com; Troy Benjegerdes troy.benjegerdes@sifive.com; Anup Patel anup.patel@wdc.com; Sagar Kadam sagar.kadam@sifive.com; Rick Chen rick@andestech.com; Tero Kristo t-kristo@ti.com; Simon Glass sjg@chromium.org; Adam Ford aford173@gmail.com; Eugen Hristev eugen.hristev@microchip.com; Peng Fan peng.fan@nxp.com; Finley Xiao finley.xiao@rock-chips.com; Kever Yang kever.yang@rock-chips.com Subject: Re: [PATCH v7 01/22] misc: add driver for the SiFive otp controller
[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe
On Sat, May 2, 2020 at 9:48 PM Pragnesh Patel pragnesh.patel@sifive.com wrote:
Hi Jagan,
-----Original Message----- From: Jagan Teki jagan@amarulasolutions.com Sent: 02 May 2020 21:21 To: Pragnesh Patel pragnesh.patel@sifive.com Cc: U-Boot-Denx u-boot@lists.denx.de; Atish Patra atish.patra@wdc.com; Palmer Dabbelt palmerdabbelt@google.com;
Bin
Meng bmeng.cn@gmail.com; Paul Walmsley
Troy Benjegerdes troy.benjegerdes@sifive.com; Anup Patel anup.patel@wdc.com; Sagar Kadam sagar.kadam@sifive.com; Rick
Chen
rick@andestech.com; Tero Kristo t-kristo@ti.com; Simon Glass sjg@chromium.org; Adam Ford aford173@gmail.com; Eugen Hristev eugen.hristev@microchip.com; Peng Fan peng.fan@nxp.com; Finley Xiao finley.xiao@rock-chips.com; Kever Yang kever.yang@rock-chips.com Subject: Re: [PATCH v7 01/22] misc: add driver for the SiFive otp controller
[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe
On Sat, May 2, 2020 at 9:12 PM Pragnesh Patel pragnesh.patel@sifive.com wrote:
Hi Jagan,
-----Original Message----- From: Jagan Teki jagan@amarulasolutions.com Sent: 02 May 2020 21:07 To: Pragnesh Patel pragnesh.patel@sifive.com Cc: U-Boot-Denx u-boot@lists.denx.de; Atish Patra atish.patra@wdc.com; Palmer Dabbelt
Bin
Meng bmeng.cn@gmail.com; Paul Walmsley
Troy Benjegerdes troy.benjegerdes@sifive.com; Anup Patel anup.patel@wdc.com; Sagar Kadam sagar.kadam@sifive.com; Rick
Chen
rick@andestech.com; Tero Kristo t-kristo@ti.com; Simon Glass sjg@chromium.org; Adam Ford aford173@gmail.com; Eugen
Hristev
eugen.hristev@microchip.com; Peng Fan peng.fan@nxp.com;
Finley
Xiao finley.xiao@rock-chips.com; Kever Yang kever.yang@rock-chips.com Subject: Re: [PATCH v7 01/22] misc: add driver for the SiFive otp controller
[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe
On Sat, May 2, 2020 at 3:37 PM Pragnesh Patel pragnesh.patel@sifive.com wrote:
Added a misc driver to handle OTP memory in SiFive SoCs.
Signed-off-by: Pragnesh Patel pragnesh.patel@sifive.com
drivers/misc/Kconfig | 7 + drivers/misc/Makefile | 1 + drivers/misc/sifive-otp.c | 273 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 281 insertions(+) create mode 100644 drivers/misc/sifive-otp.c
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 766402745d..03464f1010 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -68,6 +68,13 @@ config ROCKCHIP_OTP addressing and a length or through child-nodes that are
generated
based on the e-fuse map retrieved from the DTS.
+config SIFIVE_OTP
bool "SiFive eMemory OTP driver"
depends on RISCV && MISC
This can be something like this.
config SIFIVE_OTP bool "SiFive eMemory OTP driver" depends on SIFIVE_FU540
This config option is not FU540 specific but it's for all SiFive SoCs.
Well RISCV is not SIFIVE, better add SIFIVE_FU540 as of now if you have more SoC's in future will update by adding one more or add new
symbol SIFIVE.
IMHO it's better not to make it SoC specific, Board Kconfig file will imply this
option if needed.
This is something we follow for FU540.
SIFIVE_OTP is depends on SIFIVE SoCs and all SIFIVE SoCs are RISCV specific that's why I added depends on RISCV.
Well not all RISCV SoC's are SiFive, since you have SIFIVE_FU540 now add depends for now rest will follow similar or common config item for SiFive socs in future. Check any driver in drivers or drivers/misc it is common notation.
Already remove the depends on RISCV in v8. Making a common config for SiFive SoCs is good option that we will do in future and that common Kconfig will imply or select all the necessary config option.
If you will see, other Kconfig in drivers/misc then they are not depend on SoC but SoC config (configs/**defconfig) file Will select it.
Ideally, SIFIVE_OTP is also not depends on SIFIVE_FU540 so it's better to select or implied SIFIVE_OTP by board Kconfig. Right now, SIFIVE_OTP is implied by "board/sifive/fu540/Kconfig".
Jagan.