| /rk3399_rockchip-uboot/lib/ |
| H A D | circbuf.c | 14 int buf_init (circbuf_t * buf, unsigned int size) in buf_init() argument 16 assert (buf != NULL); in buf_init() 18 buf->size = 0; in buf_init() 19 buf->totalsize = size; in buf_init() 20 buf->data = (char *) malloc (sizeof (char) * size); in buf_init() 21 assert (buf->data != NULL); in buf_init() 23 buf->top = buf->data; in buf_init() 24 buf->tail = buf->data; in buf_init() 25 buf->end = &(buf->data[size]); in buf_init() 30 int buf_free (circbuf_t * buf) in buf_free() argument [all …]
|
| H A D | vsprintf.c | 50 static char *put_dec_trunc(char *buf, unsigned q) in put_dec_trunc() argument 60 *buf++ = d0 + '0'; /* least significant digit */ in put_dec_trunc() 65 *buf++ = d1 + '0'; /* next digit */ in put_dec_trunc() 71 *buf++ = d2 + '0'; /* next digit */ in put_dec_trunc() 77 *buf++ = d3 + '0'; /* next digit */ in put_dec_trunc() 79 *buf++ = q + '0'; /* most sign. digit */ in put_dec_trunc() 83 return buf; in put_dec_trunc() 86 static char *put_dec_full(char *buf, unsigned q) in put_dec_full() argument 108 *buf++ = d0 + '0'; in put_dec_full() 112 *buf++ = d1 + '0'; in put_dec_full() [all …]
|
| /rk3399_rockchip-uboot/drivers/rtc/ |
| H A D | rs5c372.c | 63 rs5c372_readram(unsigned char *buf, int len) in rs5c372_readram() argument 67 ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, 0, 0, buf, len); in rs5c372_readram() 73 if (buf[0] & STATUS_XPT) in rs5c372_readram() 82 unsigned char buf[RS5C372_RAM_SIZE + 1]; in rs5c372_enable() local 86 ret = rs5c372_readram(&buf[1], RS5C372_RAM_SIZE); in rs5c372_enable() 92 buf[0] = 0; in rs5c372_enable() 96 buf[ret - 1] = buf[ret]; in rs5c372_enable() 98 buf[8] = RATE_32768HZ; /* reg. 7 */ in rs5c372_enable() 99 buf[9] = 0; /* reg. 8 */ in rs5c372_enable() 100 buf[10] = 0; /* reg. 9 */ in rs5c372_enable() [all …]
|
| H A D | m41t62.c | 57 u8 buf[M41T62_DATETIME_REG_SIZE]; in rtc_get() local 59 i2c_read(CONFIG_SYS_I2C_RTC_ADDR, 0, 1, buf, M41T62_DATETIME_REG_SIZE); in rtc_get() 64 buf[0], buf[1], buf[2], buf[3], in rtc_get() 65 buf[4], buf[5], buf[6], buf[7]); in rtc_get() 67 tm->tm_sec = bcd2bin(buf[M41T62_REG_SEC] & 0x7f); in rtc_get() 68 tm->tm_min = bcd2bin(buf[M41T62_REG_MIN] & 0x7f); in rtc_get() 69 tm->tm_hour = bcd2bin(buf[M41T62_REG_HOUR] & 0x3f); in rtc_get() 70 tm->tm_mday = bcd2bin(buf[M41T62_REG_DAY] & 0x3f); in rtc_get() 71 tm->tm_wday = buf[M41T62_REG_WDAY] & 0x07; in rtc_get() 72 tm->tm_mon = bcd2bin(buf[M41T62_REG_MON] & 0x1f); in rtc_get() [all …]
|
| H A D | x1205.c | 92 u8 buf[8]; in rtc_get() local 94 i2c_read(CONFIG_SYS_I2C_RTC_ADDR, X1205_CCR_BASE, 2, buf, 8); in rtc_get() 99 buf[0], buf[1], buf[2], buf[3], in rtc_get() 100 buf[4], buf[5], buf[6], buf[7]); in rtc_get() 102 tm->tm_sec = bcd2bin(buf[CCR_SEC]); in rtc_get() 103 tm->tm_min = bcd2bin(buf[CCR_MIN]); in rtc_get() 104 tm->tm_hour = bcd2bin(buf[CCR_HOUR] & 0x3F); /* hr is 0-23 */ in rtc_get() 105 tm->tm_mday = bcd2bin(buf[CCR_MDAY]); in rtc_get() 106 tm->tm_mon = bcd2bin(buf[CCR_MONTH]); /* mon is 0-11 */ in rtc_get() 107 tm->tm_year = bcd2bin(buf[CCR_YEAR]) in rtc_get() [all …]
|
| H A D | rv3029.c | 44 unsigned char buf[RTC_RV3029_PAGE_LEN]; in rtc_get() local 46 ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, RTC_RV3029_CLOCK_PAGE, 1, buf, \ in rtc_get() 52 tmp->tm_sec = bcd2bin( buf[RV3029C2_W_SECONDS] & 0x7f); in rtc_get() 53 tmp->tm_min = bcd2bin( buf[RV3029C2_W_MINUTES] & 0x7f); in rtc_get() 54 if (buf[RV3029C2_W_HOURS] & RV3029C2_REG_HR_12_24) { in rtc_get() 56 tmp->tm_hour = bcd2bin(buf[RV3029C2_W_HOURS] & 0x1f); in rtc_get() 57 if (buf[RV3029C2_W_HOURS] & RV3029C2_REG_HR_PM) in rtc_get() 61 tmp->tm_hour = bcd2bin(buf[RV3029C2_W_HOURS] & 0x3f); in rtc_get() 63 tmp->tm_mday = bcd2bin( buf[RV3029C2_W_DATE] & 0x3F ); in rtc_get() 64 tmp->tm_mon = bcd2bin( buf[RV3029C2_W_MONTHS] & 0x1F ); in rtc_get() [all …]
|
| H A D | pcf2127.c | 27 uchar buf[8]; in pcf2127_rtc_set() local 31 buf[i++] = PCF2127_REG_SC; in pcf2127_rtc_set() 34 buf[i++] = bin2bcd(tm->tm_sec); in pcf2127_rtc_set() 35 buf[i++] = bin2bcd(tm->tm_min); in pcf2127_rtc_set() 36 buf[i++] = bin2bcd(tm->tm_hour); in pcf2127_rtc_set() 37 buf[i++] = bin2bcd(tm->tm_mday); in pcf2127_rtc_set() 38 buf[i++] = tm->tm_wday & 0x07; in pcf2127_rtc_set() 41 buf[i++] = bin2bcd(tm->tm_mon + 1); in pcf2127_rtc_set() 44 buf[i++] = bin2bcd(tm->tm_year % 100); in pcf2127_rtc_set() 47 ret = dm_i2c_write(dev, PCF2127_REG_CTRL1, buf, sizeof(buf)); in pcf2127_rtc_set() [all …]
|
| H A D | m41t94.c | 38 u8 buf[8]; /* write cmd + 7 registers */ in rtc_set() local 50 buf[0] = 0x80 | M41T94_REG_SECONDS; /* write time + date */ in rtc_set() 51 buf[M41T94_REG_SECONDS] = bin2bcd(tm->tm_sec); in rtc_set() 52 buf[M41T94_REG_MINUTES] = bin2bcd(tm->tm_min); in rtc_set() 53 buf[M41T94_REG_HOURS] = bin2bcd(tm->tm_hour); in rtc_set() 54 buf[M41T94_REG_WDAY] = bin2bcd(tm->tm_wday + 1); in rtc_set() 55 buf[M41T94_REG_DAY] = bin2bcd(tm->tm_mday); in rtc_set() 56 buf[M41T94_REG_MONTH] = bin2bcd(tm->tm_mon + 1); in rtc_set() 58 buf[M41T94_REG_HOURS] |= M41T94_BIT_CEB; in rtc_set() 60 buf[M41T94_REG_HOURS] |= M41T94_BIT_CB; in rtc_set() [all …]
|
| /rk3399_rockchip-uboot/drivers/power/ |
| H A D | power_i2c.c | 21 unsigned char buf[4] = { 0 }; in pmic_reg_write() local 31 buf[2] = (cpu_to_le32(val) >> 16) & 0xff; in pmic_reg_write() 32 buf[1] = (cpu_to_le32(val) >> 8) & 0xff; in pmic_reg_write() 33 buf[0] = cpu_to_le32(val) & 0xff; in pmic_reg_write() 35 buf[0] = (cpu_to_le32(val) >> 16) & 0xff; in pmic_reg_write() 36 buf[1] = (cpu_to_le32(val) >> 8) & 0xff; in pmic_reg_write() 37 buf[2] = cpu_to_le32(val) & 0xff; in pmic_reg_write() 42 buf[1] = (cpu_to_le32(val) >> 8) & 0xff; in pmic_reg_write() 43 buf[0] = cpu_to_le32(val) & 0xff; in pmic_reg_write() 45 buf[0] = (cpu_to_le32(val) >> 8) & 0xff; in pmic_reg_write() [all …]
|
| /rk3399_rockchip-uboot/test/dm/ |
| H A D | i2c.c | 49 uint8_t buf[5]; in dm_test_i2c_read_write() local 53 ut_assertok(dm_i2c_read(dev, 0, buf, 5)); in dm_test_i2c_read_write() 54 ut_assertok(memcmp(buf, "\0\0\0\0\0", sizeof(buf))); in dm_test_i2c_read_write() 56 ut_assertok(dm_i2c_read(dev, 0, buf, 5)); in dm_test_i2c_read_write() 57 ut_assertok(memcmp(buf, "\0\0AB\0", sizeof(buf))); in dm_test_i2c_read_write() 66 uint8_t buf[5]; in dm_test_i2c_speed() local 74 ut_assertok(dm_i2c_read(dev, 0, buf, 5)); in dm_test_i2c_speed() 77 ut_assertok(dm_i2c_read(dev, 0, buf, 5)); in dm_test_i2c_speed() 78 ut_asserteq(-EINVAL, dm_i2c_write(dev, 0, buf, 5)); in dm_test_i2c_speed() 88 uint8_t buf[5]; in dm_test_i2c_offset_len() local [all …]
|
| H A D | gpio.c | 26 char buf[80]; in dm_test_gpio() local 53 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); in dm_test_gpio() 54 ut_asserteq_str("b4: input: 0 [ ]", buf); in dm_test_gpio() 58 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); in dm_test_gpio() 59 ut_asserteq_str("b4: output: 0 [ ]", buf); in dm_test_gpio() 62 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); in dm_test_gpio() 63 ut_asserteq_str("b4: output: 1 [ ]", buf); in dm_test_gpio() 66 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); in dm_test_gpio() 67 ut_asserteq_str("b4: output: 1 [x] testing", buf); in dm_test_gpio() 73 ut_assertok(gpio_get_status(dev, offset, buf, sizeof(buf))); in dm_test_gpio() [all …]
|
| /rk3399_rockchip-uboot/board/keymile/common/ |
| H A D | ivm.c | 15 static int ivm_calc_crc(unsigned char *buf, int len) in ivm_calc_crc() argument 30 byte = buf[i]; in ivm_calc_crc() 58 static int ivm_get_value(unsigned char *buf, int len, char *name, int off, in ivm_get_value() argument 64 if ((buf[off + 0] != buf[off + 2]) && in ivm_get_value() 65 (buf[off + 2] != buf[off + 4])) { in ivm_get_value() 69 val = buf[off + 0] + (buf[off + 1] << 8); in ivm_get_value() 103 unsigned char *buf) in ivm_findinventorystring() argument 125 if (buf[addr] == '\r') in ivm_findinventorystring() 136 for (; (buf[addr] != '\r') && in ivm_findinventorystring() 137 ((buf[addr] != ';') || (!stop)) && in ivm_findinventorystring() [all …]
|
| /rk3399_rockchip-uboot/examples/standalone/ |
| H A D | atmel_df_pow2.c | 17 static int flash_cmd(struct spi_slave *slave, uchar cmd, uchar *buf, int len) in flash_cmd() argument 19 buf[0] = cmd; in flash_cmd() 20 return spi_xfer(slave, 8 * len, buf, buf, SPI_XFER_BEGIN | SPI_XFER_END); in flash_cmd() 25 uchar buf[2]; in flash_status() local 26 if (flash_cmd(slave, CMD_STAT, buf, sizeof(buf))) in flash_status() 28 return buf[1]; in flash_status() 34 uchar buf[4]; in flash_set_pow2() local 36 buf[1] = 0x2a; in flash_set_pow2() 37 buf[2] = 0x80; in flash_set_pow2() 38 buf[3] = 0xa6; in flash_set_pow2() [all …]
|
| /rk3399_rockchip-uboot/drivers/power/pmic/ |
| H A D | pmic_tps65910.c | 20 uchar buf; in tps65910_set_i2c_control() local 24 &buf, 1); in tps65910_set_i2c_control() 29 buf |= TPS65910_DEVCTRL_REG_SR_CTL_I2C_SEL_CTL_I2C; in tps65910_set_i2c_control() 32 &buf, 1); in tps65910_set_i2c_control() 43 uchar buf; in tps65910_voltage_update() local 53 ret = i2c_read(TPS65910_CTRL_I2C_ADDR, reg_offset, 1, &buf, 1); in tps65910_voltage_update() 57 buf &= ~TPS65910_OP_REG_CMD_MASK; in tps65910_voltage_update() 59 ret = i2c_write(TPS65910_CTRL_I2C_ADDR, reg_offset, 1, &buf, 1); in tps65910_voltage_update() 64 ret = i2c_read(TPS65910_CTRL_I2C_ADDR, reg_offset, 1, &buf, 1); in tps65910_voltage_update() 68 buf &= ~TPS65910_OP_REG_SEL_MASK; in tps65910_voltage_update() [all …]
|
| /rk3399_rockchip-uboot/drivers/fpga/ |
| H A D | zynqmppl.c | 49 static u32 load_word(const void *buf, u32 swap) in load_word() argument 52 u8 *bitc = (u8 *)buf; in load_word() 70 static u32 check_header(const void *buf) in check_header() argument 74 u32 *test = (u32 *)buf; in check_header() 98 buf, swap == SWAP_NO ? "without" : "with"); in check_header() 103 static void *check_data(u8 *buf, size_t bsize, u32 *swap) in check_data() argument 109 word = load_word(&buf[p], SWAP_NO); in check_data() 110 debug("%s: word %x %x/%px\n", __func__, word, p, &buf[p]); in check_data() 115 __func__, p, &buf[p]); in check_data() 116 *swap = check_header(&buf[p]); in check_data() [all …]
|
| H A D | zynqpl.c | 67 static u32 load_word(const void *buf, u32 swap) in load_word() argument 70 u8 *bitc = (u8 *)buf; in load_word() 88 static u32 check_header(const void *buf) in check_header() argument 92 u32 *test = (u32 *)buf; in check_header() 121 (u32)buf, swap == SWAP_NO ? "without" : "with"); in check_header() 126 static void *check_data(u8 *buf, size_t bsize, u32 *swap) in check_data() argument 132 word = load_word(&buf[p], SWAP_NO); in check_data() 133 debug("%s: word %x %x/%x\n", __func__, word, p, (u32)&buf[p]); in check_data() 138 __func__, p, (u32)&buf[p]); in check_data() 139 *swap = check_header(&buf[p]); in check_data() [all …]
|
| /rk3399_rockchip-uboot/lib/zlib/ |
| H A D | adler32.c | 15 #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} argument 16 #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); argument 17 #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); argument 18 #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); argument 19 #define DO16(buf) DO8(buf,0); DO8(buf,8); argument 57 uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) in adler32() argument 68 adler += buf[0]; in adler32() 78 if (buf == Z_NULL) in adler32() 84 adler += *buf++; in adler32() 98 DO16(buf); /* 16 sums unrolled */ in adler32() [all …]
|
| /rk3399_rockchip-uboot/cmd/ddr_tool/ |
| H A D | io_map.c | 21 uchar buf[CPU_2_IO_ALIGN_LEN]; in data_cpu_2_io() local 24 if ((len % sizeof(buf)) || !len) in data_cpu_2_io() 28 len /= sizeof(buf); in data_cpu_2_io() 30 memset(buf, 0, sizeof(buf)); in data_cpu_2_io() 31 for (i = 0; i < sizeof(buf); i++) in data_cpu_2_io() 32 buf[i] = val[(i % 4) * 4 + i / 4 + j * sizeof(buf)]; in data_cpu_2_io() 33 memcpy(&val[j * sizeof(buf)], buf, sizeof(buf)); in data_cpu_2_io() 38 memset(buf, 0, sizeof(buf)); in data_cpu_2_io() 40 buf[i] = val[(i % 4) * 2 + i / 4 + j * 8]; in data_cpu_2_io() 41 memcpy(&val[j * 8], buf, 8); in data_cpu_2_io()
|
| /rk3399_rockchip-uboot/board/congatec/conga-qeval20-qa3-e3845/ |
| H A D | conga-qeval20-qa3.c | 34 u8 buf[8]; in board_late_init() local 48 dm_i2c_read(dev, 0x00, buf, 1); in board_late_init() 55 buf[0] = 0x93; in board_late_init() 56 dm_i2c_write(dev, 0x06, buf, 1); in board_late_init() 58 buf[0] = 0xaa; in board_late_init() 59 dm_i2c_write(dev, 0xf8, buf, 1); in board_late_init() 61 buf[0] = 0x0f; in board_late_init() 62 dm_i2c_write(dev, 0xfa, buf, 1); in board_late_init() 64 buf[0] = 0x01; in board_late_init() 65 dm_i2c_write(dev, 0xff, buf, 1); in board_late_init()
|
| /rk3399_rockchip-uboot/common/spl/ |
| H A D | spl_ymodem.c | 29 char *buf; member 43 char *buf = info->buf; in ymodem_read_fit() local 46 res = xyzModem_stream_read(buf, BUF_SIZE, &err); in ymodem_read_fit() 54 memcpy(addr, &buf[BUF_SIZE - res], res); in ymodem_read_fit() 59 res = xyzModem_stream_read(buf, BUF_SIZE, &err); in ymodem_read_fit() 63 memcpy(addr, buf, res); in ymodem_read_fit() 79 char buf[BUF_SIZE]; in spl_ymodem_load_image() local 89 res = xyzModem_stream_read(buf, BUF_SIZE, &err); in spl_ymodem_load_image() 94 image_get_magic((struct image_header *)buf) == FDT_MAGIC) { in spl_ymodem_load_image() 103 info.buf = buf; in spl_ymodem_load_image() [all …]
|
| /rk3399_rockchip-uboot/arch/m68k/include/asm/ |
| H A D | io.h | 47 #define insb(port, buf, ns) _insb((u8 *)((port)+_IO_BASE), (buf), (ns)) argument 48 #define outsb(port, buf, ns) _outsb((u8 *)((port)+_IO_BASE), (buf), (ns)) argument 49 #define insw(port, buf, ns) _insw_ns((u16 *)((port)+_IO_BASE), (buf), (ns)) argument 50 #define outsw(port, buf, ns) _outsw_ns((u16 *)((port)+_IO_BASE), (buf), (ns)) argument 51 #define insl(port, buf, nl) _insl_ns((u32 *)((port)+_IO_BASE), (buf), (nl)) argument 52 #define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+_IO_BASE), (buf), (nl)) argument 70 static inline void _insb(volatile u8 * port, void *buf, int ns) in _insb() argument 72 u8 *data = (u8 *) buf; in _insb() 77 static inline void _outsb(volatile u8 * port, const void *buf, int ns) in _outsb() argument 79 u8 *data = (u8 *) buf; in _outsb() [all …]
|
| /rk3399_rockchip-uboot/cmd/ |
| H A D | script_update.c | 76 char *next_line, *script, *buf; in do_script() local 92 buf = calloc(SCRIPT_FILE_MAX_SIZE, 1); in do_script() 93 if (!buf) in do_script() 96 script = buf; in do_script() 97 memcpy(buf, (char *)addr, SCRIPT_FILE_MAX_SIZE); in do_script() 104 free(buf); in do_script() 115 char *buf; in do_sd_update() local 133 buf = memalign(ARCH_DMA_MINALIGN, SCRIPT_FILE_MAX_SIZE * 2); in do_sd_update() 134 if (!buf) in do_sd_update() 141 "fatload mmc 1 0x%08lx sd_update.txt", (ulong)buf); in do_sd_update() [all …]
|
| /rk3399_rockchip-uboot/board/Marvell/mvebu_armada-8k/ |
| H A D | board.c | 51 u8 buf[8]; in board_xhci_config() local 65 ret = dm_i2c_read(dev, I2C_IO_CFG_REG_0, buf, 1); in board_xhci_config() 70 buf[0] &= ~I2C_IO_REG_VBUS; in board_xhci_config() 71 buf[0] &= ~I2C_IO_REG_CL; in board_xhci_config() 72 ret = dm_i2c_write(dev, I2C_IO_CFG_REG_0, buf, 1); in board_xhci_config() 79 ret = dm_i2c_read(dev, I2C_IO_DATA_OUT_REG_0, buf, 1); in board_xhci_config() 84 buf[0] &= ~I2C_IO_REG_VBUS; in board_xhci_config() 85 buf[0] |= I2C_IO_REG_CL; in board_xhci_config() 86 ret = dm_i2c_write(dev, I2C_IO_DATA_OUT_REG_0, buf, 1); in board_xhci_config() 102 u8 buf[8]; in board_xhci_enable() local [all …]
|
| /rk3399_rockchip-uboot/drivers/bootcount/ |
| H A D | bootcount_ext.c | 15 u8 *buf; in bootcount_store() local 25 buf = map_sysmem(CONFIG_SYS_BOOTCOUNT_ADDR, 2); in bootcount_store() 26 buf[0] = BC_MAGIC; in bootcount_store() 27 buf[1] = (a & 0xff); in bootcount_store() 28 unmap_sysmem(buf); in bootcount_store() 38 u8 *buf; in bootcount_load() local 55 buf = map_sysmem(CONFIG_SYS_BOOTCOUNT_ADDR, 2); in bootcount_load() 56 if (buf[0] == BC_MAGIC) in bootcount_load() 57 ret = buf[1]; in bootcount_load() 59 unmap_sysmem(buf); in bootcount_load()
|
| /rk3399_rockchip-uboot/tools/gdb/ |
| H A D | remote.c | 382 hexnumstr (char *buf, ULONGEST num) in hexnumstr() argument 387 buf[len] = '\0'; in hexnumstr() 391 buf[i] = "0123456789abcdef"[(num & 0xf)]; in hexnumstr() 428 char *buf = alloca (PBUFSIZ); in check_binary_download() local 432 p = buf; in check_binary_download() 440 putpkt_binary (buf, (int) (p - buf)); in check_binary_download() 441 getpkt (buf, 0); in check_binary_download() 443 if (buf[0] == '\0') in check_binary_download() 472 unsigned char *buf = alloca (PBUFSIZ); local 499 p = buf; [all …]
|