[U-Boot] [RFC PATCH 01/20] sandbox: Add architecture header files

Mike Frysinger vapier at gentoo.org
Sun Sep 18 01:54:41 CEST 2011


On Saturday, September 17, 2011 12:48:40 Simon Glass wrote:
> --- /dev/null
> +++ b/arch/sandbox/include/asm/arch-sandbox/clock.h
> 
> +enum periph_id {
> +	PERIPH_COUNT
> +};

is this needed by anything ?

> --- /dev/null
> +++ b/arch/sandbox/include/asm/arch-sandbox/gpio.h
>
> +enum {
> +	GPIO_COUNT	= 255,		/* Number of GPIOs */
> +};

are these needed for anything ?

> +int gpio_direction_input(int gp);
> +int gpio_direction_output(int gp, int value);
> +int gpio_get_value(int gp);
> +void gpio_set_value(int gp, int value);

let's use this new sandbox arch as an excuse to populate asm-generic/ further

> --- /dev/null
> +++ b/arch/sandbox/include/asm/posix_types.h
>
> +typedef struct {
> +#if defined(__KERNEL__) || defined(__USE_ALL)
> +	int	val[2];
> +#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
> +	int	__val[2];
> +#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
> +} __kernel_fsid_t;
> +
> +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
> +
> +#undef	__FD_SET
> +#define __FD_SET(fd, fdsetp) \
> +		(((fd_set *)fdsetp)->fds_bits[fd >> 5] |= (1<<(fd & 31)))
> +
> +#undef	__FD_CLR
> +#define __FD_CLR(fd, fdsetp) \
> +		(((fd_set *)fdsetp)->fds_bits[fd >> 5] &= ~(1<<(fd & 31)))
> +
> +#undef	__FD_ISSET
> +#define __FD_ISSET(fd, fdsetp) \
> +		((((fd_set *)fdsetp)->fds_bits[fd >> 5] & (1<<(fd & 31))) != 0)
> +
> +#undef	__FD_ZERO
> +#define __FD_ZERO(fdsetp) \
> +		(memset(fdsetp, 0, sizeof(*(fd_set *)fdsetp)))

pretty sure u-boot doesnt use this, so just drop it

> --- /dev/null
> +++ b/arch/sandbox/include/asm/ptrace.h
>
> +/* This is not used in the sandbox architecture, but required by U-Boot */
> +struct pt_regs {
> +	long dummy;
> +};

does it actually need to have "dummy" ?

> --- /dev/null
> +++ b/arch/sandbox/include/asm/string.h

this file looks like it should simply include linux/string.h

> --- /dev/null
> +++ b/arch/sandbox/include/asm/u-boot-sandbox.h
>
> +/* cpu/.../cpu.c */
> +int	cpu_init(void);
> +int	cleanup_before_linux(void);
> +
> +/* cpu/.../arch/cpu.c */
> +int	arch_cpu_init(void);
> +int	arch_misc_init(void);
> +
> +/* board/.../... */
> +int	board_init(void);
> +int	dram_init(void);
> +void	dram_init_banksize(void);
> +
> +/* cpu/.../interrupt.c */
> +int	arch_interrupt_init(void);
> +void	reset_timer_masked(void);
> +ulong	get_timer_masked(void);
> +void	udelay_masked(unsigned long usec);

are these actually needed ?  or should these get punted ?

> +/* common/cmd_nvedit.c */
> +int	setenv(const char *, const char *);

this arch header shouldnt contain prototypes for non-arch stuff

> +/* cpu/.../timer.c */
> +int	timer_init(void);

already in common.h

> --- /dev/null
> +++ b/arch/sandbox/include/asm/unaligned.h

include asm-generic/unaligned.h rather than writing your own
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110917/e78c09fb/attachment.pgp 


More information about the U-Boot mailing list