On 10/10/2018 09:51 AM, Sascha Hauer wrote: >> +static inline int hab_get_status(void) >> +{ >> + if (IS_ENABLED(CONFIG_MMU)) >> + return -EIO; > > This restriction makes this patch rather unhandy to use. Internally we > use imx*_hab_get_status() indeed with MMU enabled and it works fine, but > we call it before mmu_init is called. In this state the MMU is enabled > already, but the zero page is not yet set to faulting. So I think the > problem is not the MMU as such, but instead the faulting zero page. BTW: The faulting zero page problem doesn't occur on mx25 and mx28 as the HAB ROM doesn't live at 0x0: #define HABV4_RVT_IMX28 0xffff8af8 int imx25_hab_get_status(void) { return imx_habv3_get_status(readl(IOMEM(0x780018d4))); } > It would be great if we could overcome this issue. One way to do this > would be to add a function pair mmu_zero_page_map() and > mmu_zero_page_set_faulting() to be called in hab_get_status(). > > I don't know if you are willing to add that, but I don't want to > motivate people to disable the MMU, so the patch is not acceptable as > is. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |