forked from sanpeqf/w80xprog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
w80xprog.h
40 lines (33 loc) · 1.17 KB
/
w80xprog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright(c) 2021 Sanpe <[email protected]>
*/
#ifndef _W80XPROG_H_
#define _W80XPROG_H_
#include "w80xhw.h"
#include <stdbool.h>
#define ETH_ALEN 6
#define ETH_HEX_ALEN 12
/* crc16.c */
uint16_t crc16_xmodem(const uint8_t *src, unsigned int len);
uint16_t crc16_ccitt(const uint8_t *src, unsigned int len);
/* termios.c */
extern int termios_open(char *path);
extern int termios_setspeed(unsigned int speed);
extern int termios_flush(void);
extern int termios_setup(unsigned int speed, int databits, int stopbits, char parity);
extern int termios_rts(bool enable);
extern int termios_read(void *data, unsigned long len);
extern int termios_write(const void *data, unsigned long len);
extern int termios_print(const char *str);
/* w80xprog.c */
extern int entry_secboot(void);
extern int serial_speed(unsigned int speed);
extern int flash_bmac(const char *bmac);
extern int flash_wmac(const char *wmac);
extern int flash_gain(const char *bmac);
extern int spinor_flash(uint8_t *src, unsigned long len);
extern int spinor_erase(unsigned long size);
extern int chip_info(void);
extern int chip_reset(void);
#endif /* _W80XPROG_H_ */