From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 2 May 2019 12:17:33 +0200 Subject: [U-Boot] [PATCH v2] arm: socfpga: Move Stratix 10 SDRAM driver to DM In-Reply-To: References: <1556086869-13501-1-git-send-email-ley.foon.tan@intel.com> <9fdf5c74-cfd8-b551-9f6b-313a799c5a4c@denx.de> Message-ID: <7c57c94a-6f9a-a860-c18d-d8991d10c621@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 On 5/2/19 5:46 AM, Ley Foon Tan wrote: > On Tue, Apr 30, 2019 at 5:56 PM Marek Vasut wrote: >> >> On 4/30/19 9:40 AM, Ley Foon Tan wrote: >> [...] >>>>>>> +static int altera_sdram_probe(struct udevice *dev) >>>>>>> +{ >>>>>>> + int ret; >>>>>>> + struct reset_ctl_bulk resets; >>>>>>> + >>>>>>> + ret = reset_get_bulk(dev, &resets); >>>>>>> + if (ret) { >>>>>>> + dev_err(dev, "Can't get reset: %d\n", ret); >>>>>>> + return -ENODEV; >>>>>>> + } >>>>>>> + reset_deassert_bulk(&resets); >>>>>>> + >>>>>>> + if (sdram_mmr_init_full(dev) != 0) { >>>>>>> + puts("SDRAM init failed.\n"); >>>>>>> + goto failed; >>>>>>> + } >>>>>>> + >>>>>>> + return 0; >>>>>>> + >>>>>>> +failed: >>>>>>> + reset_release_bulk(&resets); >>>>>>> + return -ENODEV; >>>>>>> } >>>>>> Are you missing altera_sdram_remove() , which would assert reset here ? >>>>> Will add it. >>>> >>>> But won't that prevent the DRAM controller from working ? >>> Added assert reset in _remove, SDRAM controller still can work after >>> boot to Uboot. >>> Seem _remove is not called when boot to Uboot. >> >> Look at DM_FLAG_OS_PREPARE > Tested add DM_FLAG_OS_PREPARE flag, but still didn't see it call to _remove(). > > BTW, I think we shouldn't assert SDRAM controller. Otherwise, SDRAM is > not working in next boot stage. Hence my question above -- "But won't that prevent the DRAM controller from working ?" I think you're right. -- Best regards, Marek Vasut