From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmPtd-0005gp-9A for qemu-devel@nongnu.org; Wed, 04 Jul 2012 09:45:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmPtY-0002mw-6k for qemu-devel@nongnu.org; Wed, 04 Jul 2012 09:45:32 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:45170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmPtY-0002ly-0e for qemu-devel@nongnu.org; Wed, 04 Jul 2012 09:45:28 -0400 Received: from eusync2.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M6N009HI28ICK50@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Wed, 04 Jul 2012 14:45:54 +0100 (BST) Received: from [106.109.9.187] by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0M6N002HZ27MDF60@eusync2.samsung.com> for qemu-devel@nongnu.org; Wed, 04 Jul 2012 14:45:24 +0100 (BST) Date: Wed, 04 Jul 2012 17:45:20 +0400 From: Maksim Kozlov In-reply-to: Message-id: <4FF448F0.4050809@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: QUOTED-PRINTABLE References: <1341393721-3606-1-git-send-email-m.kozlov@samsung.com> <1341393721-3606-2-git-send-email-m.kozlov@samsung.com> Subject: Re: [Qemu-devel] [PATCH v3 1/2] ARM: exynos4210: CMU support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dunrong Huang Cc: peter.maydell@linaro.org, kyungmin.park@samsung.com, qemu-devel@nongnu.org 04.07.2012 14:38, Dunrong Huang =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> +void exynos4210_register_clock_handler(ClockChangeHandler *func, >> + Exynos4210Clock clock_id, = void *opaque) >> +{ >> + ClockChangeEntry *cce =3D g_malloc0(sizeof(ClockChangeEntry))= ; >> + Exynos4210ClockState *clock =3D exynos4210_clock_find(clock_i= d); >> + >> + if (clock =3D=3D NULL) { >> + hw_error("We aren't be able to find clock %d\n", clock_id= ); >> + } else if (clock->cmu_id =3D=3D UNSPECIFIED_CMU) { >> + >> + PRINT_DEBUG("Clock %s never are changed. Handler won't be= set.", >> + exynos4210_clock[clock_id]->name); >> + >> + return; >> + } >> + >> + cce->func =3D func; >> + cce->opaque =3D opaque; >> + >> + QTAILQ_INSERT_TAIL(&clock->clock_change_handler, cce, entry); >> + >> + PRINT_DEBUG("For %s have been set handler [%p]\n", clock->nam= e, cce->func); >> + >> + return; > Dont need to return. Agree >> + >> +static void exynos4210_cmu_set_pll(void *opaque, Exynos4210ClockS= tate *pll) >> +{ >> + Exynos4210CmuState *s =3D opaque; >> + Exynos4210ClockState *source; >> + target_phys_addr_t offset =3D pll->div_reg; >> + ClockChangeEntry *cce; >> + uint32_t pdiv, mdiv, sdiv, enable; >> + >> + source =3D exynos4210_clock_find(pll->src_id); >> + >> + if (source =3D=3D NULL) { >> + hw_error("We haven't find source clock %d (requested for = %s)\n", >> + pll->src_id, pll->name); >> + } >> + >> + /* >> + * FOUT =3D MDIV * FIN / (PDIV * 2^(SDIV-1)) >> + */ >> + >> + enable =3D (s->reg[I_(offset)]& PLL_ENABLE_MASK)>> PLL_ENAB= LE_SHIFT; >> + mdiv =3D (s->reg[I_(offset)]& PLL_MDIV_MASK)>> PLL_MDIV_S= HIFT; >> + pdiv =3D (s->reg[I_(offset)]& PLL_PDIV_MASK)>> PLL_PDIV_S= HIFT; >> + sdiv =3D (s->reg[I_(offset)]& PLL_SDIV_MASK)>> PLL_SDIV_S= HIFT; >> + >> + if (source) { >> + if (enable) { >> + pll->rate =3D mdiv * source->rate / (pdiv * (1<< (sd= iv-1))); >> + } else { >> + pll->rate =3D 0; >> + } >> + } else { >> + hw_error("%s: Source undefined for %s\n", __func__, pll->= name); >> + } >> + >> + QTAILQ_FOREACH(cce,&pll->clock_change_handler, entry) { >> + cce->func(cce->opaque); >> + } >> + >> + PRINT_DEBUG("%s rate: %llu\n", pll->name, pll->rate); > pll->rate is of type uint64_t incompatible with "%llu" Type uint64_t is included from /usr/include/stdint.h as typedef unsigned long long int=09uint64_t; and 'll' specifies that a following 'u' conversion specifier applies = to=20 a unsigned long long argument Why do you think they incompatible? -- MK