Commit e831ad54aa7524d977f89fbd1056f902ff8a9b05

Authored by wdenk
1 parent eee810b61d

Initial revision

Showing 3 changed files with 225 additions and 0 deletions Side-by-side Diff

  1 +#
  2 +# (C) Copyright 2000-2002
  3 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4 +#
  5 +# See file CREDITS for list of people who contributed to this
  6 +# project.
  7 +#
  8 +# This program is free software; you can redistribute it and/or
  9 +# modify it under the terms of the GNU General Public License as
  10 +# published by the Free Software Foundation; either version 2 of
  11 +# the License, or (at your option) any later version.
  12 +#
  13 +# This program is distributed in the hope that it will be useful,
  14 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 +# GNU General Public License for more details.
  17 +#
  18 +# You should have received a copy of the GNU General Public License
  19 +# along with this program; if not, write to the Free Software
  20 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21 +# MA 02111-1307 USA
  22 +#
  23 +
  24 +include $(TOPDIR)/config.mk
  25 +
  26 +LIB = lib$(BOARD).a
  27 +
  28 +OBJS := trab.o flash.o vfd.o
  29 +SOBJS := memsetup.o
  30 +
  31 +$(LIB): $(OBJS) $(SOBJS)
  32 + $(AR) crv $@ $^
  33 +
  34 +clean:
  35 + rm -f $(SOBJS) $(OBJS)
  36 +
  37 +distclean: clean
  38 + rm -f $(LIB) core *.bak .depend
  39 +
  40 +#########################################################################
  41 +
  42 +.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
  43 + $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
  44 +
  45 +-include .depend
  46 +
  47 +#########################################################################
  1 +#
  2 +# (C) Copyright 2000, 2001
  3 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4 +#
  5 +# See file CREDITS for list of people who contributed to this
  6 +# project.
  7 +#
  8 +# This program is free software; you can redistribute it and/or
  9 +# modify it under the terms of the GNU General Public License as
  10 +# published by the Free Software Foundation; either version 2 of
  11 +# the License, or (at your option) any later version.
  12 +#
  13 +# This program is distributed in the hope that it will be useful,
  14 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 +# GNU General Public License for more details.
  17 +#
  18 +# You should have received a copy of the GNU General Public License
  19 +# along with this program; if not, write to the Free Software
  20 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21 +# MA 02111-1307 USA
  22 +#
  23 +
  24 +include $(TOPDIR)/config.mk
  25 +
  26 +LIB = libcommon.a
  27 +
  28 +AOBJS =
  29 +
  30 +COBJS = main.o altera.o bedbug.o \
  31 + cmd_autoscript.o cmd_bedbug.o cmd_boot.o \
  32 + cmd_bootm.o cmd_cache.o cmd_console.o cmd_date.o \
  33 + cmd_dcr.o cmd_diag.o cmd_doc.o cmd_dtt.o \
  34 + cmd_eeprom.o cmd_elf.o cmd_fdc.o cmd_flash.o \
  35 + cmd_fpga.o cmd_i2c.o cmd_ide.o cmd_immap.o \
  36 + cmd_jffs2.o cmd_mem.o cmd_mii.o cmd_misc.o \
  37 + cmd_net.o cmd_nvedit.o env_common.o \
  38 + env_flash.o env_eeprom.o env_nvram.o env_nowhere.o \
  39 + cmd_pci.o cmd_pcmcia.o \
  40 + cmd_reginfo.o cmd_scsi.o cmd_vfd.o cmd_usb.o \
  41 + command.o console.o devices.o dlmalloc.o \
  42 + docecc.o environment.o flash.o fpga.o \
  43 + hush.o kgdb.o lists.o miiphybb.o miiphyutil.o \
  44 + s_record.o soft_i2c.o soft_spi.o cmd_spi.o spartan2.o \
  45 + usb.o usb_kbd.o usb_storage.o \
  46 + virtex2.o xilinx.o
  47 +
  48 +OBJS = $(AOBJS) $(COBJS)
  49 +
  50 +CPPFLAGS += -I..
  51 +
  52 +all: $(LIB) $(AOBJS)
  53 +
  54 +$(LIB): .depend $(OBJS)
  55 + $(AR) crv $@ $(OBJS)
  56 +
  57 +environment.o: environment.c ../tools/envcrc
  58 + $(CC) $(AFLAGS) -Wa,--no-warn \
  59 + -DENV_CRC=$(shell ../tools/envcrc) \
  60 + -c -o $@ environment.c
  61 +
  62 +#########################################################################
  63 +
  64 +.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
  65 + $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
  66 +
  67 +sinclude .depend
  68 +
  69 +#########################################################################
  1 +/*
  2 + * (C) Copyright 2000
  3 + * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
  4 + *
  5 + * See file CREDITS for list of people who contributed to this
  6 + * project.
  7 + *
  8 + * This program is free software; you can redistribute it and/or
  9 + * modify it under the terms of the GNU General Public License as
  10 + * published by the Free Software Foundation; either version 2 of
  11 + * the License, or (at your option) any later version.
  12 + *
  13 + * This program is distributed in the hope that it will be useful,
  14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 + * GNU General Public License for more details.
  17 + *
  18 + * You should have received a copy of the GNU General Public License
  19 + * along with this program; if not, write to the Free Software
  20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21 + * MA 02111-1307 USA
  22 + */
  23 +
  24 +#include <lists.h>
  25 +
  26 +#ifndef _DEVICES_H_
  27 +#define _DEVICES_H_
  28 +
  29 +/*
  30 + * CONSOLE DEVICES
  31 + */
  32 +
  33 +#define DEV_FLAGS_INPUT 0x00000001 /* Device can be used as input console */
  34 +#define DEV_FLAGS_OUTPUT 0x00000002 /* Device can be used as output console */
  35 +#define DEV_FLAGS_SYSTEM 0x80000000 /* Device is a system device */
  36 +#define DEV_EXT_VIDEO 0x00000001 /* Video extensions supported */
  37 +
  38 +/* Device informations */
  39 +typedef struct {
  40 + int flags; /* Device flags: input/output/system */
  41 + int ext; /* Supported extensions */
  42 + char name[8]; /* Device name */
  43 +
  44 +/* GENERAL functions */
  45 +
  46 + int (*start) (void); /* To start the device */
  47 + int (*stop) (void); /* To stop the device */
  48 +
  49 +/* OUTPUT functions */
  50 +
  51 + void (*putc) (const char c); /* To put a char */
  52 + void (*puts) (const char *s); /* To put a string (accelerator) */
  53 +
  54 +/* INPUT functions */
  55 +
  56 + int (*tstc) (void); /* To test if a char is ready... */
  57 + int (*getc) (void); /* To get that char */
  58 +
  59 +/* Other functions */
  60 +
  61 + void *priv; /* Private extensions */
  62 +} device_t;
  63 +
  64 +/*
  65 + * VIDEO EXTENSIONS
  66 + */
  67 +#define VIDEO_FORMAT_RGB_INDEXED 0x0000
  68 +#define VIDEO_FORMAT_RGB_DIRECTCOLOR 0x0001
  69 +#define VIDEO_FORMAT_YUYV_4_4_4 0x0010
  70 +#define VIDEO_FORMAT_YUYV_4_2_2 0x0011
  71 +
  72 +typedef struct {
  73 + void *address; /* Address of framebuffer */
  74 + ushort width; /* Horizontal resolution */
  75 + ushort height; /* Vertical resolution */
  76 + uchar format; /* Format */
  77 + uchar colors; /* Colors number or color depth */
  78 + void (*setcolreg) (int, int, int, int);
  79 + void (*getcolreg) (int, void *);
  80 +} video_ext_t;
  81 +
  82 +/*
  83 + * VARIABLES
  84 + */
  85 +extern list_t devlist;
  86 +extern device_t *stdio_devices[];
  87 +extern char *stdio_names[MAX_FILES];
  88 +
  89 +/*
  90 + * PROTOTYPES
  91 + */
  92 +int device_register (device_t * dev);
  93 +int devices_init (void);
  94 +int devices_done (void);
  95 +int device_deregister(char *devname);
  96 +#ifdef CONFIG_LCD
  97 +int drv_lcd_init (void);
  98 +#endif
  99 +#ifdef CONFIG_VFD
  100 +int drv_vfd_init (void);
  101 +#endif
  102 +#ifdef CONFIG_VIDEO
  103 +int drv_video_init (void);
  104 +#endif
  105 +#ifdef CONFIG_WL_4PPM_KEYBOARD
  106 +int drv_wlkbd_init (void);
  107 +#endif
  108 +
  109 +#endif /* _DEVICES_H_ */