Searched refs:divisor (Results 1 - 25 of 45) sorted by relevance

12

/u-boot/drivers/ddr/marvell/a38x/
H A Dmv_ddr_common.c32 int round_div(unsigned int dividend, unsigned int divisor, unsigned int *quotient) argument
39 if (divisor == 0) {
43 *quotient = (dividend + divisor / 2) / divisor;
H A Dmv_ddr_common.h52 int round_div(unsigned int dividend, unsigned int divisor, unsigned int *quotient);
/u-boot/lib/
H A Ddiv64.c71 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) argument
76 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder);
78 if (divisor > 0)
81 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder);
82 if (divisor < 0)
91 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
93 * @divisor: 64bit divisor
102 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) argument
104 u32 high = divisor >> 3
142 div64_u64(u64 dividend, u64 divisor) argument
170 div64_s64(s64 dividend, s64 divisor) argument
188 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) argument
[all...]
/u-boot/arch/arm/lib/
H A Dlib1funcs.S25 .macro ARM_DIV_BODY dividend, divisor, result, curbit
29 clz \curbit, \divisor
33 mov \divisor, \divisor, lsl \result
39 @ Initially shift the divisor left 3 bits if possible,
43 tst \divisor, #0xe0000000
44 moveq \divisor, \divisor, lsl #3
48 @ Unless the divisor is very big, shift it up in multiples of
50 @ division loop. Continue shifting until the divisor i
[all...]
H A Ddiv64.S5 * Optimized computation of 64-bit dividend / 32-bit divisor
31 * __do_div64: perform a division with 64-bit dividend and 32-bit divisor.
38 * r4 = divisor (preserved)
53 bls 9f @ divisor is 0 or 1
55 beq 8f @ divisor is power of 2
62 @ Align divisor with upper part of dividend.
63 @ The aligned divisor is stored in yl preserving the original.
105 @ divisor for comparisons, considering the carry-out bit as well.
142 @ divisor at this point since divisor ca
[all...]
/u-boot/arch/arm/mach-uniphier/debug-uart/
H A Ddebug-uart.c61 unsigned int divisor; local
66 divisor = uniphier_ld4_debug_uart_init();
71 divisor = uniphier_pro4_debug_uart_init();
76 divisor = uniphier_sld8_debug_uart_init();
81 divisor = uniphier_pro5_debug_uart_init();
86 divisor = uniphier_pxs2_debug_uart_init();
91 divisor = uniphier_ld6b_debug_uart_init();
100 writel(divisor, base + UNIPHIER_UART_LDR);
/u-boot/include/linux/
H A Dmath64.h14 * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder
19 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) argument
21 *remainder = dividend % divisor;
22 return dividend / divisor;
26 * div_s64_rem - signed 64bit divide with 32bit divisor with remainder
28 static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) argument
30 *remainder = dividend % divisor;
31 return dividend / divisor;
35 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
37 static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u6 argument
46 div64_u64(u64 dividend, u64 divisor) argument
57 div64_s64(s64 dividend, s64 divisor) argument
68 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) argument
101 div_u64(u64 dividend, u32 divisor) argument
112 div_s64(s64 dividend, s32 divisor) argument
122 __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) argument
232 mul_u64_u32_div(u64 a, u32 mul, u32 divisor) argument
[all...]
H A Dkernel.h98 * Divide positive or negative dividend by positive divisor and round
100 * for negative dividends if the divisor variable type is unsigned.
102 #define DIV_ROUND_CLOSEST(x, divisor)( \
105 typeof(divisor) __d = divisor; \
107 ((typeof(divisor))-1) > 0 || (__x) > 0) ? \
113 * Same as above but for u64 dividends. divisor must be a 32-bit
116 #define DIV_ROUND_CLOSEST_ULL(x, divisor)( \
118 typeof(divisor) __d = divisor; \
[all...]
/u-boot/board/nuvoton/common/
H A Duart.c27 u16 divisor; local
43 divisor = dll | (dlm << 8);
44 baudrate = uart_clk / ((16 * (divisor + 2)));
56 divisor = DIV_ROUND_CLOSEST(uart_clk, 16 * gd->baudrate) - 2;
58 writeb(divisor & 0xff, uart_reg + UART_DLL);
59 writeb(divisor >> 8, uart_reg + UART_DLM);
63 uart_clk, baudrate, uart_clk / ((16 * (divisor + 2))));
/u-boot/drivers/i2c/
H A Dast2600_i2c.c183 int divisor; local
204 divisor = DIV_ROUND_UP(apb_clk, speed);
207 divisor = DIV_ROUND_UP(base_clk1, speed);
210 divisor = DIV_ROUND_UP(base_clk2, speed);
213 divisor = DIV_ROUND_UP(base_clk3, speed);
216 divisor = DIV_ROUND_UP(base_clk4, speed);
218 while ((divisor + inc) > 32) {
219 inc |= divisor & 0x1;
220 divisor >>= 1;
223 divisor
[all...]
/u-boot/arch/mips/mach-octeon/
H A Dcvmx-helper-jtag.c34 int divisor; local
36 divisor = gd->bus_clk / (1000000 * (OCTEON_IS_MODEL(OCTEON_CN68XX) ? 10 : 25));
38 divisor = (divisor - 1) >> 2;
39 /* Convert the divisor into a power of 2 shift */
40 while (divisor) {
42 divisor >>= 1;
/u-boot/lib/zstd/common/
H A Dzstd_deps.h60 * U64 ZSTD_div64(U64 dividend, U32 divisor)
68 static uint64_t ZSTD_div64(uint64_t dividend, uint32_t divisor) { argument
69 return div_u64(dividend, divisor);
/u-boot/drivers/serial/
H A Dserial_mpc8xx.c42 int divisor = (gd->cpu_clk + 8 * baudrate) / 16 / baudrate; local
44 if (divisor / 16 > 0x1000) {
45 /* bad divisor, assume 50MHz clock and 9600 baud */
46 divisor = (50 * 1000 * 1000 + 8 * 9600) / 16 / 9600;
49 divisor /= CONFIG_SYS_BRGCLK_PRESCALE;
51 if (divisor <= 0x1000)
52 out_be32(&cp->cp_brgc1, ((divisor - 1) << 1) | CPM_BRG_EN);
54 out_be32(&cp->cp_brgc1, ((divisor / 16 - 1) << 1) | CPM_BRG_EN |
H A Dserial_pl01x.c112 unsigned int divisor; local
119 divisor = UART_PL010_BAUD_9600;
122 divisor = UART_PL010_BAUD_19200;
125 divisor = UART_PL010_BAUD_38400;
128 divisor = UART_PL010_BAUD_57600;
131 divisor = UART_PL010_BAUD_115200;
134 divisor = UART_PL010_BAUD_38400;
137 writel((divisor & 0xf00) >> 8, &regs->pl010_lcrm);
138 writel(divisor & 0xff, &regs->pl010_lcrl);
H A Daltera_uart.c24 u32 divisor; /* Baud rate divisor reg */ member in struct:altera_uart_regs
40 writel(div, &regs->divisor);
130 writel(div, &regs->divisor);
H A Dserial_npcm.c84 u16 divisor; local
90 divisor = DIV_ROUND_CLOSEST(plat->uart_clk, 16 * baudrate) - 2;
93 writeb(divisor & 0xff, &uart->dll);
94 writeb(divisor >> 8, &uart->dlm);
H A Datmel_usart.c35 unsigned long divisor; local
44 divisor = (usart_hz / 16 + baudrate / 2) / baudrate;
45 writel(USART3_BF(CD, divisor), &usart->brgr);
150 unsigned long divisor; local
152 divisor = (usart_clk_rate / 16 + baudrate / 2) / baudrate;
153 writel(USART3_BF(CD, divisor), &usart->brgr);
H A Dserial_uniphier.c43 unsigned int divisor; local
45 divisor = DIV_ROUND_CLOSEST(priv->uartclk, mode_x_div * baudrate);
51 writel(divisor, priv->membase + UNIPHIER_UART_DLR);
H A Dserial_meson.c69 * as clock source and the corresponding divisor to approximate baud
71 u32 divisor = meson_calc_baud_divisor(src_rate, baud); local
73 (divisor & AML_UART_REG5_BAUD_MASK);
171 u32 divisor = meson_calc_baud_divisor(rate, baud); local
172 u32 calc_baud = (rate / 3) / (divisor + 1);
/u-boot/drivers/pwm/
H A Dpwm-aspeed.c120 u64 div_h, div_l, divisor; local
133 divisor = (u64)NSEC_PER_SEC * (PWM_ASPEED_FIXED_PERIOD + 1) *
135 div_h = order_base_2(div64_u64((u64)rate * period_ns + divisor - 1, divisor));
139 divisor = ((u64)NSEC_PER_SEC * (PWM_ASPEED_FIXED_PERIOD + 1)) << div_h;
140 div_l = div64_u64((u64)rate * period_ns, divisor);
/u-boot/drivers/spi/
H A Dnpcm_pspi.c138 u32 divisor; local
148 divisor = DIV_ROUND_CLOSEST(apb_clock, (2 * speed)) - 1;
149 if (divisor > MAX_DIV)
150 divisor = MAX_DIV;
154 val |= divisor << PSPI_CTL1_SCDV_SHIFT;
157 debug("%s: apb_clock=%lu speed=%d divisor=%u\n",
158 __func__, apb_clock, speed, divisor);
/u-boot/drivers/mmc/
H A Dtmio-common.c564 unsigned int divisor; local
571 divisor = DIV_ROUND_UP(mclk, mmc->clock);
574 if (mmc->ddr_mode && (divisor == 1))
575 divisor = 2;
577 if (divisor <= 1)
580 else if (divisor <= 2)
582 else if (divisor <= 4)
584 else if (divisor <= 8)
586 else if (divisor <= 16)
588 else if (divisor <
[all...]
/u-boot/include/
H A Ddiv64.h41 * If the divisor happens to be constant, we determine the appropriate
198 extern u32 __div64_32(u64 *dividend, u32 divisor);
237 static inline u64 lldiv(u64 dividend, u32 divisor) argument
240 do_div(__res, divisor);
/u-boot/drivers/video/nexell/soc/
H A Ds5pxx18_soc_disptop_clk.h40 u32 divisor);
/u-boot/arch/mips/mach-octeon/include/mach/
H A Docteon_ddr.h568 static inline u64 divide_nint(u64 dividend, u64 divisor) argument
572 quotent = dividend / divisor;
573 remainder = dividend % divisor;
574 return (quotent + ((remainder * 2) >= divisor));
578 static inline u64 divide_roundup(u64 dividend, u64 divisor) argument
580 return ((dividend + divisor - 1) / divisor);

Completed in 213 milliseconds

12