2014-10-22 3:48 GMT+04:00 John Crispin <blogic@xxxxxxxxxxx>: > 1 comment inline > > On 22/10/2014 01:03, Sergey Ryazanov wrote: >> Add basic support for Atheros AR5312/AR2312 SoCs: registers >> definition file and initial setup code. >> >> Signed-off-by: Sergey Ryazanov <ryazanov.s.a@xxxxxxxxx> --- >> >> Changes since v1: - rename MIPS machine ar231x -> ath25 >> [snip] >> void __init prom_init(void) >> { >>+ if (is_ar5312()) >>+ ar5312_prom_init(); >> } > > if i am reading this correct then is_ar5312() can return true even if > CONFIG_SOC_AR5312 is not selected > Yep. It checks the version of SoC MIPS core, to distinguish chip families. If SOC_AR5312 or SOC_AR2315 not selected then respective chip specific functions are replaced by stubs. > how about > > if (IS_ENABLED(CONFIG_SOC_AR5312) && is_ar5312()) > pr_info("AR5312"); > else if (IS_ENABLED(CONFIG_SOC_AR2315) && is_ar2315()) > pr_info("AR2315"); > else > panic("failed to init memory"); > > somewhere early in the code > If you want show to user some message, when kernel was built with wrong options, then may be: #if !defined(CONFIG_SOC_AR5312) && !defined(CONFIG_SOC_AR2315) #error "You should select at least one SoC support option" #endif if (!IS_ENABLED(CONFIG_SOC_AR5312) && is_ar5312()) panic("AR5312 SoC support is not builtin"); if (!IS_ENABLED(CONFIG_SOC_AR2315) && is_ar2315()) panic("AR5312 SoC support is not builtin"); IMHO these checks in general is odd. -- BR, Sergey