From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Fri, 26 Oct 2018 13:26:48 +0200 Subject: [U-Boot] [U-Boot-DM] [PATCH] drivers: serial: probe all serial devices In-Reply-To: References: <1539562189-3137-1-git-send-email-vabhav.sharma@nxp.com> <20181025140452.0D54A240044@gemini.denx.de> Message-ID: <20181026112648.4CC2A240044@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Vabhav, In message you wrote: > > > U-Boot does lazy initialization intentionally. It is wrong to initialize devices > > which are not actually used. > There is configuration option to enable the device using platform > data or device tree using DM model. "enable" means we have all required information needed to initialize them, if we need them. The need arises only when someone wants to transfer data over that UART. If nobody uses the UArt, there is no need to ever initialize it. Lazy initialization is a good thing - it saves resources, especially memory and time. Think for example of boot time optimizations... > For e.g: 2 UART controllers are enabled in device tree but DM > model initialized only one, This is limitation In which way is this a limitation? We use only one UART (for the serial console), so it works as supposed: only the used devices are fully initialized. > My suggestion is to initialize all devices which are enabled, E.g. > use case is using UART1 for uboot consoled and UART2 for linux boot What do you mean "for Linux boot"? If Linux needs the UART, it will initialize it itself in the Linux dvice driver. > On NXP SoC, We also use UART3 for ethernet firmware logging but > using DM model all enabled devices are not probed posing > limitation. Again, this is intentional, and not a limitation. And what exactly do you mean by "UART3 for ethernet firmware logging"? Maybe you should rethink your software concept. We don't want to have a zillion of ports in used if not really necessary. Either you use standard channels (STDOUT, STDERR) for logging. Also, there used to be a syslog compatible logging driver. > > I have a feeling that you attempt to do the Wong Thing. > I quoted the reason above and also discussed on in email(23 may) " > [U-Boot-DM] QUERY:U-boot DM:SERIAL:Multiple On-chip UART > Controller Support" with suggested solution from Simon which is > sent as patch for review. But Simon also explained "U-Boot only probes things in a 'lazy' manner so far", and there should be really good reasons for deviating from this principle. In no way should a "probe all devices" be made the default. And Andreas also wrote how to solve this issue in a board-specific way if it is really, really needed on some board. However, you still fail to explain why you ned multiple serial ports in U-Boot running in parallel. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Well, the way I see it, logic is only a way of being ignorant by num- bers. - Terry Pratchett, _Small Gods_