From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sonic Zhang Date: Mon, 18 Feb 2013 15:41:04 +0800 Subject: [U-Boot] [PATCH 05/11] Blackfin: bf60x: support big cplb page In-Reply-To: References: <1360223258-6945-1-git-send-email-sonic.adi@gmail.com> <1360223258-6945-6-git-send-email-sonic.adi@gmail.com> <20130207103342.8FE84200565@gemini.denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Bob, On Mon, Feb 18, 2013 at 10:43 AM, Bob Liu wrote: > On Thu, Feb 7, 2013 at 6:33 PM, Wolfgang Denk wrote: >> Dear Sonic Zhang, >> >> In message <1360223258-6945-6-git-send-email-sonic.adi@gmail.com> you wrote: >>> From: Bob Liu >>> >>> Bf60x support 16K, 64K, 16M and 64M cplb pages, this patch add support for them. >>> So that bf609-ezkit can use it's 128M memory. >> >> Checkpatch issues, please fix. >> >> >>> -#define CPLB_PAGE_SIZE (4 * 1024 * 1024) >>> -#define CPLB_PAGE_MASK (~(CPLB_PAGE_SIZE - 1)) >> ... >>> + uint32_t cplb_page_size; >>> + uint32_t cplb_page_mask; >> ... >>> + cplb_page_size = (4 * 1024 * 1024); >>> + cplb_page_mask = (~(cplb_page_size - 1)); >> ... >>> - mbase &= CPLB_PAGE_MASK; >>> - mend &= CPLB_PAGE_MASK; >>> + mbase &= cplb_page_mask; >>> + mend &= cplb_page_mask; >> >> What exsactly is the reason for replacing a compile-time calculation >> with a run-time one? >> > > Because bf60x will use different cplb page size in some place, if > don't use run-time variable then > more marco and #ifdef are needed. > I prefer to reuse this code with run-time variable. Thanks for explanation. I changed your run-time variable into new macro to avoid this problem. Regards, Sonic