tinyx-devel Mailing List for Tinyx RTOS
Status: Planning
Brought to you by:
davidcohen
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(4) |
Nov
|
Dec
(106) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(69) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Felipe B. <me...@fe...> - 2008-01-19 14:18:20
|
Hi David, all I think we should change a little bit our plans for Tinyx. What i noticed is that console and printf features is not really a MUST right now. Better of coding ADC/DAC and SCHED as we could use them to, for instance, for controlling a Brushed DC Motor using PWM. AFAICT, seeing something really working is better than printing a string in a serial console. A serial console will be really good for debugging but we'd be better using a JTAG interface for such debugging. At least for now. What i'm proposing is that we stop a bit coding libc and console and switch to other stuff like ADC/DAC and SCHED. What do you think? -- Best Regards, Felipe Balbi me...@fe... http://blog.felipebalbi.com |
From: David C. <da...@gm...> - 2008-01-19 02:53:42
|
Pushing it. Br, David On Jan 18, 2008 10:38 PM, David Cohen <da...@gm...> wrote: > This patch fixes the description on include/asm-arm7/device.h file. > > Signed-off-by: David Cohen <da...@gm...> > --- > include/asm-arm7/device.h | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/include/asm-arm7/device.h b/include/asm-arm7/device.h > index dbde227..26ede4f 100644 > --- a/include/asm-arm7/device.h > +++ b/include/asm-arm7/device.h > @@ -1,4 +1,4 @@ > -/* include/asm-arm7/arch-lpc2xxx/device.h > +/* include/asm-arm7/device.h > * > * Copyright (C) 2007 David Cohen <da...@gm...> > * Copyright (C) 2007 Felipe Balbi <me...@fe...> > -- > 1.5.3.8 > > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-19 02:39:00
|
This patch fixes the description on include/asm-arm7/device.h file. Signed-off-by: David Cohen <da...@gm...> --- include/asm-arm7/device.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/asm-arm7/device.h b/include/asm-arm7/device.h index dbde227..26ede4f 100644 --- a/include/asm-arm7/device.h +++ b/include/asm-arm7/device.h @@ -1,4 +1,4 @@ -/* include/asm-arm7/arch-lpc2xxx/device.h +/* include/asm-arm7/device.h * * Copyright (C) 2007 David Cohen <da...@gm...> * Copyright (C) 2007 Felipe Balbi <me...@fe...> -- 1.5.3.8 |
From: David C. <da...@gm...> - 2008-01-19 00:49:23
|
Pushing it. Br, David On Jan 17, 2008 2:56 PM, Felipe Balbi <me...@fe...> wrote: > On Thu, Jan 17, 2008 at 02:45:53PM -0400, David Cohen wrote: > > This patch adds tags/TAGS file + asm and asm-*/arch to not be tracked by git. > > > > Signed-off-by: David Cohen <da...@gm...> > > Acked-by: Felipe Balbi <me...@fe...> > > > --- > > .gitignore | 4 ++++ > > include/.gitignore | 4 ++++ > > 2 files changed, 8 insertions(+), 0 deletions(-) > > create mode 100644 include/.gitignore > > > > diff --git a/.gitignore b/.gitignore > > index e56a517..810f986 100644 > > --- a/.gitignore > > +++ b/.gitignore > > @@ -7,3 +7,7 @@ > > *.patch > > *.diff > > > > +# tags file > > +tags > > +TAGS > > + > > diff --git a/include/.gitignore b/include/.gitignore > > new file mode 100644 > > index 0000000..0819ff5 > > --- /dev/null > > +++ b/include/.gitignore > > @@ -0,0 +1,4 @@ > > +# linked dirs > > +asm > > +asm-*/arch > > + > > -- > > 1.5.3.5 > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > Tinyx-devel mailing list > > Tin...@li... > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > -- > Best Regards, > > Felipe Balbi > me...@fe... > http://blog.felipebalbi.com > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: Felipe B. <me...@fe...> - 2008-01-17 19:09:20
|
Hi David, Anderson, I'm starting out the application structure and proposing a test application which will be a way to use tinyx for controlling a Brushed DC Motor. FYI, a Brushed DC Motor is used for controlling electric windows on cars. The biggest issue we can see is when we try to find a way to easily control the speed of this task. The only way to do this without a uController is messing around with circuitry, when we have a uController, we can use PWM to control the motor's velocity. The structure i was thinking is: <tinyx>/app/<app_name>/<app_files>.[ch] something like: tinyx/app/motor/ motor.c motor.h README ... Any comments ?? PS: this way we could show something working on tinyx -- Best Regards, Felipe Balbi me...@fe... http://blog.felipebalbi.com |
From: Felipe B. <me...@fe...> - 2008-01-17 18:54:33
|
On Thu, Jan 17, 2008 at 02:45:53PM -0400, David Cohen wrote: > This patch adds tags/TAGS file + asm and asm-*/arch to not be tracked by git. > > Signed-off-by: David Cohen <da...@gm...> Acked-by: Felipe Balbi <me...@fe...> > --- > .gitignore | 4 ++++ > include/.gitignore | 4 ++++ > 2 files changed, 8 insertions(+), 0 deletions(-) > create mode 100644 include/.gitignore > > diff --git a/.gitignore b/.gitignore > index e56a517..810f986 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -7,3 +7,7 @@ > *.patch > *.diff > > +# tags file > +tags > +TAGS > + > diff --git a/include/.gitignore b/include/.gitignore > new file mode 100644 > index 0000000..0819ff5 > --- /dev/null > +++ b/include/.gitignore > @@ -0,0 +1,4 @@ > +# linked dirs > +asm > +asm-*/arch > + > -- > 1.5.3.5 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel -- Best Regards, Felipe Balbi me...@fe... http://blog.felipebalbi.com |
From: David C. <da...@gm...> - 2008-01-17 18:47:21
|
This patch adds tags/TAGS file + asm and asm-*/arch to not be tracked by git. Signed-off-by: David Cohen <da...@gm...> --- .gitignore | 4 ++++ include/.gitignore | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-) create mode 100644 include/.gitignore diff --git a/.gitignore b/.gitignore index e56a517..810f986 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ *.patch *.diff +# tags file +tags +TAGS + diff --git a/include/.gitignore b/include/.gitignore new file mode 100644 index 0000000..0819ff5 --- /dev/null +++ b/include/.gitignore @@ -0,0 +1,4 @@ +# linked dirs +asm +asm-*/arch + -- 1.5.3.5 |
From: Felipe B. <me...@fe...> - 2008-01-15 13:17:50
|
Hi, On Mon, 14 Jan 2008 21:57:08 -0400, David Cohen <da...@gm...> wrote: > This patch adds .patch and .diff file types to not be tracked by git. > > Signed-off-by: David Cohen <da...@gm...> Acked-by: Felipe Balbi <me...@fe...> > --- > .gitignore | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/.gitignore b/.gitignore > index 168d6bf..e56a517 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -2,3 +2,8 @@ > *.o > *.elf > *.hex > + > +# Patch files > +*.patch > +*.diff > + > -- > 1.5.3.7 Just to explain a bit: we can have per-directory .gitignore files in case we wanna ignore that special file type only in that directory. Not true in tinyx yet ;-) > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel -- Best Regards, Felipe Balbi http://felipebalbi.com me...@fe... |
From: David C. <da...@gm...> - 2008-01-15 01:57:00
|
This patch adds .patch and .diff file types to not be tracked by git. Signed-off-by: David Cohen <da...@gm...> --- .gitignore | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 168d6bf..e56a517 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,8 @@ *.o *.elf *.hex + +# Patch files +*.patch +*.diff + -- 1.5.3.7 |
From: David C. <da...@gm...> - 2008-01-13 17:05:56
|
Pushing all three patches. David On Jan 12, 2008 12:55 PM, David Cohen <da...@gm...> wrote: > This patch improves generic clock subsystem. > > Signed-off-by: David Cohen <da...@gm...> > --- > arch/common/clock.c | 89 +++++++++++++++++++++++++++++++----------- > include/asm-generic/clock.h | 23 +++++++---- > 2 files changed, 80 insertions(+), 32 deletions(-) > > diff --git a/arch/common/clock.c b/arch/common/clock.c > index d92f09e..32296f8 100644 > --- a/arch/common/clock.c > +++ b/arch/common/clock.c > @@ -22,54 +22,95 @@ > #include <asm-generic/clock.h> > #include <tinyx/list.h> > > -static struct clock *clk_list; > -static unsigned int num_clk; > +static struct clock **clk_list; > > -void clk_set_list(struct clock *list, unsigned int num) > +unsigned int clk_get_rate(unsigned int id) > { > - clk_list = list; > - num_clk = num; > + struct clock **list = clk_list; > + struct clock *clk = NULL; > + > + while (*list) { > + clk = *list; > + if (clk->id == id) > + break; > + list++; > + } > + > + return clk ? clk->rate : 0; > } > > -void clk_propagate(struct clock *clk, struct clock *parent) > +void clk_propagate(struct clock *clk) > { > - unsigned int c; > - struct clock *child; > + struct clock **list; > > if (clk == NULL) > return; > > if (clk->propagate) > - (*clk->propagate)(clk, parent); > + (*clk->propagate)(clk); > > - c = clk->num_child; > - child = clk->child; > + list = clk->child_list; > > /* Revisit: fix recursive while */ > - while (c--) { > - clk_propagate(child, clk); > - child++; > + while (*list) { > + clk_propagate(*list); > + list++; > } > } > > -unsigned int clk_set_rate(struct clock *clk, unsigned int rate) > +unsigned int clk_set_rate(struct clock *clk, unsigned int clk_rate) > { > - unsigned int clk_rate = rate; > - unsigned int c; > - struct clock *child; > + unsigned int *rate_list; > + struct clock **list; > > if (clk == NULL) > return 0; > > + rate_list = clk->rate_list; > + while (*rate_list) { > + if (clk_rate >= (*rate_list)) { > + clk_rate = *rate_list; > + break; > + } > + rate_list++; > + } > + if (!(*rate_list)) > + clk_rate = 0; > + > if (clk->set_rate) > - clk_rate = (*clk->set_rate)(clk, rate); > + clk_rate = (*clk->set_rate)(clk, clk_rate); > > - c = clk->num_child; > - child = clk->child; > - while (c--) { > - clk_propagate(child, clk); > - child++; > + list = clk->child_list; > + while (*list) { > + struct clock *child = *list; > + > + child = *list; > + if (!(child->flags & CLK_INITIALIZED)) { > + clk_set_rate(child, child->rate); > + child->flags |= CLK_INITIALIZED; > + } else > + clk_propagate(child); > + list++; > } > > return clk_rate; > } > + > +void clk_set_list(struct clock **list, unsigned int num) > +{ > + clk_list = list; > + > + while (*list) { > + struct clock *clk = *list; > + > + if ((clk->flags & CLK_PRIMARY) && > + !(clk->flags & CLK_INITIALIZED)) { > + if (clk->init) > + (*clk->init)(clk); > + clk_set_rate(clk, clk->rate); > + clk->flags |= CLK_INITIALIZED; > + } > + list++; > + } > +} > + > diff --git a/include/asm-generic/clock.h b/include/asm-generic/clock.h > index 4ac8e7c..6560eb6 100644 > --- a/include/asm-generic/clock.h > +++ b/include/asm-generic/clock.h > @@ -22,20 +22,27 @@ > #ifndef __ASM_GENERIC_CLOCK_H > #define __ASM_GENERIC_CLOCK_H > > +#define CLK_ENABLED (1 << 0) > +#define CLK_INITIALIZED (1 << 1) > +#define CLK_PRIMARY (1 << 2) > + > struct clock { > unsigned int id; > unsigned int rate; > + unsigned int flags; > struct clock *parent; > - struct clock *child; > - unsigned int num_child; > + struct clock **child_list; > + > unsigned int (*set_rate) (struct clock *clk, unsigned int rate); > - void (*propagate) (struct clock *clk, struct clock *parent); > -}; > + void (*propagate) (struct clock *clk); > + void (*init) (struct clock *clk); > > -#define clk_get_rate(clk) (clk)->rate > + unsigned int rate_list[]; > +}; > > -extern void clk_set_list(struct clock *list, unsigned int num); > -extern void clk_propagate(struct clock *clk, struct clock *parent); > -extern unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > +void clk_set_list(struct clock **list, unsigned int num); > +unsigned int clk_get_rate(unsigned int id); > +void clk_propagate(struct clock *clk); > +unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > > #endif /* __ASM_GENERIC_CLOCK_H */ > -- > 1.5.3.7 > > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-13 17:05:13
|
Pushing it. David On Jan 12, 2008 12:39 PM, David Cohen <da...@gm...> wrote: > This patch removes PLL codes from asm startup file. > The PLL code will be moved to clock subsystem. > > Signed-off-by: David Cohen <da...@gm...> > --- > arch/arm7/mach-lpc21xx/start_lpc2148.S | 56 ------------------------- > include/asm-arm7/arch-lpc2xxx/start_lpc2148.h | 7 --- > 2 files changed, 0 insertions(+), 63 deletions(-) > > diff --git a/arch/arm7/mach-lpc21xx/start_lpc2148.S b/arch/arm7/mach-lpc21xx/start_lpc2148.S > index b76d9b3..f97bd82 100644 > --- a/arch/arm7/mach-lpc21xx/start_lpc2148.S > +++ b/arch/arm7/mach-lpc21xx/start_lpc2148.S > @@ -42,29 +42,6 @@ > .equ sram_top, SRAM_TOP > .equ stackTop, SRAM_TOP > > -#define VAL_PLLCFG_MSEL ((PLL_MSEL - 1) << 0) > -#if (PLL_PSEL == 1) > -#define PLL_PSEL_VALUE 0x00 > -#elif (PLL_PSEL == 2) > -#define PLL_PSEL_VALUE 0x01 > -#elif (PLL_PSEL == 4) > -#define PLL_PSEL_VALUE 0x10 > -#elif (PLL_PSEL == 8) > -#define PLL_PSEL_VALUE 0x11 > -#endif > -#define VAL_PLLCFG_PSEL (PLL_PSEL_VALUE << 5) > -#define VAL_PLLCFG (VAL_PLLCFG_MSEL | VAL_PLLCFG_PSEL) > - > -# Phase Locked Loop (PLL) definitions > - .equ PLL_BASE, 0xE01FC080 /* PLL Base Address */ > - .equ PLLCON_OFS, 0x00 /* PLL Control Offset*/ > - .equ PLLCFG_OFS, 0x04 /* PLL Configuration Offset */ > - .equ PLLSTAT_OFS, 0x08 /* PLL Status Offset */ > - .equ PLLFEED_OFS, 0x0C /* PLL Feed Offset */ > - .equ PLLCON_PLLE, (1<<0) /* PLL Enable */ > - .equ PLLCON_PLLC, (1<<1) /* PLL Connect */ > - .equ PLLSTAT_PLOCK, (1<<10) /* PLL Lock Status */ > - > #define HANDLER(HandlerLabel,HandleLabel) \ > HandlerLabel: ;\ > sub sp, sp, #4 ;\ > @@ -159,39 +136,6 @@ fiqHandlerAddress: > # Reset Handler > handleReset: > > -#if (USE_PLL == 1) > - LDR R0, =PLL_BASE > - MOV R1, #0xAA > - MOV R2, #0x55 > - > -# Disable PLL before programming (in case it was enabled before) > - MOV R3, #0 > - STR R3, [R0, #PLLCON_OFS] > - STR R1, [R0, #PLLFEED_OFS] > - STR R2, [R0, #PLLFEED_OFS] > - > -# Wait for > -# Configure and Enable PLL > - MOV R3, #VAL_PLLCFG > - STR R3, [R0, #PLLCFG_OFS] > - MOV R3, #PLLCON_PLLE > - STR R3, [R0, #PLLCON_OFS] > - STR R1, [R0, #PLLFEED_OFS] > - STR R2, [R0, #PLLFEED_OFS] > - > -# Wait until PLL Locked > -PLL_Loop: LDR R3, [R0, #PLLSTAT_OFS] > - ANDS R3, R3, #PLLSTAT_PLOCK > - BEQ PLL_Loop > - > -# Switch to PLL Clock > - MOV R3, #(PLLCON_PLLE | PLLCON_PLLC) > - STR R3, [R0, #PLLCON_OFS] > - STR R1, [R0, #PLLFEED_OFS] > - STR R2, [R0, #PLLFEED_OFS] > -#endif > - > - > # Setup Stack for each mode > LDR R0, =stackTop > > diff --git a/include/asm-arm7/arch-lpc2xxx/start_lpc2148.h b/include/asm-arm7/arch-lpc2xxx/start_lpc2148.h > index 28f9e30..9e93f30 100644 > --- a/include/asm-arm7/arch-lpc2xxx/start_lpc2148.h > +++ b/include/asm-arm7/arch-lpc2xxx/start_lpc2148.h > @@ -24,15 +24,8 @@ > > #define FOSC 12000000 > > -#define PLL_MSEL 5 > -#define PLL_PSEL 2 > #define VPB_DIV 4 > > -#define CCLK (FOSC * PLL_MSEL) > -#define FCCO (CCLK * 2 * PLL_PSEL) > -#define PCLK (CCLK / VPB_DIV) > - > -#define USE_PLL 1 > #define MAM_MAP 1 > > /* setup stack sizes */ > -- > 1.5.3.7 > > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-13 15:54:00
|
This patch adds missing \ on clean target. Whithout it, the last line on this target is not executed. Signed-off-by: David Cohen <da...@gm...> --- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 386622d..3618ec0 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ clean: cleanobjs="$$cleanobjs $$dir*.o"; \ done; \ echo "rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps"; \ - rm -f include/asm/arch + rm -f include/asm/arch \ rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; -- 1.5.3.7 |
From: David C. <da...@gm...> - 2008-01-13 04:10:46
|
Puhshing this one, following Felipe's comment for CPU macro. David On Jan 12, 2008 8:08 PM, David Cohen <da...@gm...> wrote: > This patch adds symbolic path to include/asm/arch directory and use gcc > instead of ld to link final tinyx image. > > Signed-off-by: David Cohen <da...@gm...> > --- > Makefile | 14 ++++++++------ > 1 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/Makefile b/Makefile > index 3b0a471..b4e49ed 100644 > --- a/Makefile > +++ b/Makefile > @@ -9,6 +9,7 @@ HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer > CROSS_COMPILE ?= arm-linux- > > ARCH = arm7 > +CPU = lpc2xxx > > AS = $(CROSS_COMPILE)as > LD = $(CROSS_COMPILE)ld > @@ -19,7 +20,7 @@ STRIP = $(CROSS_COMPILE)strip > OBJCOPY = $(CROSS_COMPILE)objcopy > OBJDUMP = $(CROSS_COMPILE)objdump > AWK = awk > -CFLAGS = -Wall -Os -mcpu=arm7tdmi > +CFLAGS = -Wall -Os -mcpu=arm7tdmi -nostdlib > INCLUDES = -Iinclude -Iinclude/libc > > PYTHON = python > @@ -28,14 +29,15 @@ MAKEFLAGS += --no-print-directory > > all-sources = $(shell git-ls-files) > > -export ARCH AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES > +export ARCH CPU AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES > > tinyx.dirs = lib/ arch/ kernel/ > > tinyx.objs = $(patsubst %/, %/tyx_part.o, $(tinyx.dirs)) > > -$(shell rm -f $(tinyx.objs) include/asm) > +$(shell rm -f $(tinyx.objs) include/asm/arch include/asm) > $(shell ln -s asm-$(ARCH) include/asm) > +$(shell ln -s arch-$(CPU) include/asm/arch) > > > _all: > > @@ -52,7 +54,8 @@ tinyx.hex: tinyx.elf > $(OBJCOPY) -O ihex build/$< build/$@ > > tinyx.elf: $(tinyx.objs) > - $(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > + #$(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > + $(CC) -Xlinker --script=arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > > $(tinyx.objs): > @$(MAKE) target=$@ -f scripts/Makefile.build > @@ -63,7 +66,6 @@ endef > > tags: > $(call xtags, ctags) > - > .PHONY: clean > clean: > @cleandirs="$(shell $(PYTHON) scripts/expandtree.py $(tinyx.dirs))"; \ > @@ -72,6 +74,6 @@ clean: > cleanobjs="$$cleanobjs $$dir*.o"; \ > done; \ > echo "rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps"; \ > - rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; > + rm -f $$cleanobjs include/asm/arch include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; > > > -- > 1.5.3.7 > > |
From: David C. <da...@gm...> - 2008-01-13 04:07:56
|
Pushing this. Br, David On Jan 12, 2008 12:33 PM, David Cohen <da...@gm...> wrote: > Removing unused include/Makefile file. > > Signed-off-by: David Cohen <da...@gm...> > --- > include/Makefile | 2 -- > 1 files changed, 0 insertions(+), 2 deletions(-) > delete mode 100644 include/Makefile > > diff --git a/include/Makefile b/include/Makefile > deleted file mode 100644 > index 02b7b52..0000000 > --- a/include/Makefile > +++ /dev/null > @@ -1,2 +0,0 @@ > -asm: > - ln -s asm-$(ARCH) asm > -- > 1.5.3.7 > > |
From: David C. <da...@gm...> - 2008-01-13 00:33:44
|
Hi, So, this is how to use libc headers. Like on standard C, without any extra path. I'll push it now as it is simple and urgent, in order to not break any new patch. Br, David On Jan 12, 2008 8:30 PM, David Cohen <da...@gm...> wrote: > Adding include/libc to standard include's path > Fixing new libc include path on device.c > > Signed-off-by: David Cohen <da...@gm...> > --- > Makefile | 2 +- > kernel/device.c | 2 +- > lib/libc/strerror.c | 2 +- > lib/libc/string.c | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/Makefile b/Makefile > index 0ca9772..3b0a471 100644 > --- a/Makefile > +++ b/Makefile > @@ -20,7 +20,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy > OBJDUMP = $(CROSS_COMPILE)objdump > AWK = awk > CFLAGS = -Wall -Os -mcpu=arm7tdmi > -INCLUDES = -Iinclude > +INCLUDES = -Iinclude -Iinclude/libc > > PYTHON = python > > diff --git a/kernel/device.c b/kernel/device.c > index 44374ab..8cd35ba 100644 > --- a/kernel/device.c > +++ b/kernel/device.c > @@ -21,7 +21,7 @@ > > #include <tinyx/device.h> > #include <tinyx/list.h> > -#include <tinyx/libc/string.h> > +#include <string.h> > > DECLARE_LIST_HEAD(bus_list); > DECLARE_LIST_HEAD(driver_list); > diff --git a/lib/libc/strerror.c b/lib/libc/strerror.c > index cd189a8..ceeb466 100644 > --- a/lib/libc/strerror.c > +++ b/lib/libc/strerror.c > @@ -19,7 +19,7 @@ > * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > */ > > -#include <libc/string.h> > +#include <string.h> > #include <tinyx/errno.h> > > #ifdef DEBUG > diff --git a/lib/libc/string.c b/lib/libc/string.c > index 1a26851..3f738fb 100644 > --- a/lib/libc/string.c > +++ b/lib/libc/string.c > @@ -19,7 +19,7 @@ > * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > */ > > -#include <libc/string.h> > +#include <string.h> > > /** > * memset - Fill a memory region with data > -- > 1.5.3.7 > > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-13 00:32:18
|
Adding include/libc to standard include's path Fixing new libc include path on device.c Signed-off-by: David Cohen <da...@gm...> --- Makefile | 2 +- kernel/device.c | 2 +- lib/libc/strerror.c | 2 +- lib/libc/string.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0ca9772..3b0a471 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump AWK = awk CFLAGS = -Wall -Os -mcpu=arm7tdmi -INCLUDES = -Iinclude +INCLUDES = -Iinclude -Iinclude/libc PYTHON = python diff --git a/kernel/device.c b/kernel/device.c index 44374ab..8cd35ba 100644 --- a/kernel/device.c +++ b/kernel/device.c @@ -21,7 +21,7 @@ #include <tinyx/device.h> #include <tinyx/list.h> -#include <tinyx/libc/string.h> +#include <string.h> DECLARE_LIST_HEAD(bus_list); DECLARE_LIST_HEAD(driver_list); diff --git a/lib/libc/strerror.c b/lib/libc/strerror.c index cd189a8..ceeb466 100644 --- a/lib/libc/strerror.c +++ b/lib/libc/strerror.c @@ -19,7 +19,7 @@ * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. */ -#include <libc/string.h> +#include <string.h> #include <tinyx/errno.h> #ifdef DEBUG diff --git a/lib/libc/string.c b/lib/libc/string.c index 1a26851..3f738fb 100644 --- a/lib/libc/string.c +++ b/lib/libc/string.c @@ -19,7 +19,7 @@ * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. */ -#include <libc/string.h> +#include <string.h> /** * memset - Fill a memory region with data -- 1.5.3.7 |
From: David C. <da...@gm...> - 2008-01-13 00:08:15
|
This patch adds symbolic path to include/asm/arch directory and use gcc instead of ld to link final tinyx image. Signed-off-by: David Cohen <da...@gm...> --- Makefile | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3b0a471..b4e49ed 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer CROSS_COMPILE ?= arm-linux- ARCH = arm7 +CPU = lpc2xxx AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld @@ -19,7 +20,7 @@ STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump AWK = awk -CFLAGS = -Wall -Os -mcpu=arm7tdmi +CFLAGS = -Wall -Os -mcpu=arm7tdmi -nostdlib INCLUDES = -Iinclude -Iinclude/libc PYTHON = python @@ -28,14 +29,15 @@ MAKEFLAGS += --no-print-directory all-sources = $(shell git-ls-files) -export ARCH AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES +export ARCH CPU AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES tinyx.dirs = lib/ arch/ kernel/ tinyx.objs = $(patsubst %/, %/tyx_part.o, $(tinyx.dirs)) -$(shell rm -f $(tinyx.objs) include/asm) +$(shell rm -f $(tinyx.objs) include/asm/arch include/asm) $(shell ln -s asm-$(ARCH) include/asm) +$(shell ln -s arch-$(CPU) include/asm/arch) _all: @@ -52,7 +54,8 @@ tinyx.hex: tinyx.elf $(OBJCOPY) -O ihex build/$< build/$@ tinyx.elf: $(tinyx.objs) - $(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) + #$(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) + $(CC) -Xlinker --script=arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) $(tinyx.objs): @$(MAKE) target=$@ -f scripts/Makefile.build @@ -63,7 +66,6 @@ endef tags: $(call xtags, ctags) - .PHONY: clean clean: @cleandirs="$(shell $(PYTHON) scripts/expandtree.py $(tinyx.dirs))"; \ @@ -72,6 +74,6 @@ clean: cleanobjs="$$cleanobjs $$dir*.o"; \ done; \ echo "rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps"; \ - rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; + rm -f $$cleanobjs include/asm/arch include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; -- 1.5.3.7 |
From: David C. <da...@gm...> - 2008-01-12 20:12:37
|
Hi, On 1/12/08, Felipe Balbi <me...@fe...> wrote: > On Sat, Jan 12, 2008 at 12:58:31PM -0400, David Cohen wrote: > > Hi all, > > > > We have to decide it. > > Which one is better choice: > > <libc/string.h> or <string.h>? > > <string.h> > > but you should change all the users of it in your patch > So, I will do it. Br, David > > > > Br, > > > > David > > > > On Jan 10, 2008 11:43 PM, David Cohen <da...@gm...> wrote: > > > Hi, > > > > > > On Jan 10, 2008 11:39 PM, Anderson Briglia <and...@br...> wrote: > > > > On 1/10/08, David Cohen <da...@gm...> wrote: > > > > > > > > > This is the other way for libc include's path. > > > > > > > > > > Any comments? Briglia? Balbi? > > > > > > > > IMHO, this way is the default, right? I still didn't see differents > > > > include's paths due to different archs on linux kernel. > > > > > > You're right, but the arch's path is transparent. The two choices are: > > > <libc/string.h> or <string.h> > > > > > > Which one is better? > > > > > > Regards, > > > > > > David > > > > > > > > > > > > > > BR, > > > > > > > > Anderson Briglia > > > > > > > > > > > > > > > > > > > > > > > > Br, > > > > > > > > > > David Cohen > > > > > > > > > > On Jan 10, 2008 11:02 PM, David Cohen < da...@gm...> wrote: > > > > > > Adding include/libc to standard include's path > > > > > > Fixing new libc include path on device.c > > > > > > > > > > > > Signed-off-by: David Cohen < da...@gm...> > > > > > > --- > > > > > > Makefile | 2 +- > > > > > > kernel/device.c | 2 +- > > > > > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > > > > > > > > > diff --git a/Makefile b/Makefile > > > > > > index 0ca9772..3b0a471 100644 > > > > > > --- a/Makefile > > > > > > +++ b/Makefile > > > > > > @@ -20,7 +20,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy > > > > > > OBJDUMP = $(CROSS_COMPILE)objdump > > > > > > AWK = awk > > > > > > CFLAGS = -Wall -Os -mcpu=arm7tdmi > > > > > > -INCLUDES = -Iinclude > > > > > > +INCLUDES = -Iinclude -Iinclude/libc > > > > > > > > > > > > PYTHON = python > > > > > > > > > > > > diff --git a/kernel/device.c b/kernel/device.c > > > > > > index 44374ab..8cd35ba 100644 > > > > > > --- a/kernel/device.c > > > > > > +++ b/kernel/device.c > > > > > > @@ -21,7 +21,7 @@ > > > > > > > > > > > > #include <tinyx/device.h> > > > > > > #include <tinyx/list.h> > > > > > > -#include <tinyx/libc/string.h> > > > > > > +#include <string.h > > > > > > > > > > > > > DECLARE_LIST_HEAD(bus_list); > > > > > > DECLARE_LIST_HEAD(driver_list); > > > > > > -- > > > > > > 1.5.3.7 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > David Cohen > > > > > Instituto Nokia de Tecnologia - INdT > > > > > Manaus - Brazil > > > > > > > > > > ------------------------------------------------------------------------- > > > > > Check out the new SourceForge.net Marketplace. > > > > > It's the best place to buy or sell services for > > > > > just about anything Open Source. > > > > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > > _______________________________________________ > > > > > Tinyx-devel mailing list > > > > > Tin...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > > > > > > > > > > > > > > > > > > > > > > > -- > > David Cohen > > Instituto Nokia de Tecnologia - INdT > > Manaus - Brazil > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > _______________________________________________ > > Tinyx-devel mailing list > > Tin...@li... > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > -- > Best Regards, > > Felipe Balbi > me...@fe... > http://blog.felipebalbi.com > |
From: David C. <da...@gm...> - 2008-01-12 20:09:00
|
Hi, On 1/12/08, Felipe Balbi <me...@fe...> wrote: > On Sat, Jan 12, 2008 at 12:33:29PM -0400, David Cohen wrote: > > This patch adds symbolic path to include/asm/arch directory and use gcc > > instead of ld to link final tinyx image. > > > > Signed-off-by: David Cohen <da...@gm...> > > --- > > Makefile | 14 ++++++++------ > > 1 files changed, 8 insertions(+), 6 deletions(-) > > > > diff --git a/Makefile b/Makefile > > index 3b0a471..f452c11 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -9,6 +9,7 @@ HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer > > CROSS_COMPILE ?= arm-linux- > > > > ARCH = arm7 > > +MODEL = lpc2xxx > > CPU would look better here. I agree. I' ll change to cpu. Br, David > > We could later, > if cpu_is_lpc2xxx() > and let gcc do the optimizations. > > > > > AS = $(CROSS_COMPILE)as > > LD = $(CROSS_COMPILE)ld > > @@ -19,7 +20,7 @@ STRIP = $(CROSS_COMPILE)strip > > OBJCOPY = $(CROSS_COMPILE)objcopy > > OBJDUMP = $(CROSS_COMPILE)objdump > > AWK = awk > > -CFLAGS = -Wall -Os -mcpu=arm7tdmi > > +CFLAGS = -Wall -Os -mcpu=arm7tdmi -nostdlib > > INCLUDES = -Iinclude -Iinclude/libc > > > > PYTHON = python > > @@ -28,14 +29,15 @@ MAKEFLAGS += --no-print-directory > > > > all-sources = $(shell git-ls-files) > > > > -export ARCH AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES > > +export ARCH MODEL AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES > > > > tinyx.dirs = lib/ arch/ kernel/ > > > > tinyx.objs = $(patsubst %/, %/tyx_part.o, $(tinyx.dirs)) > > > > -$(shell rm -f $(tinyx.objs) include/asm) > > +$(shell rm -f $(tinyx.objs) include/asm/arch include/asm) > > $(shell ln -s asm-$(ARCH) include/asm) > > +$(shell ln -s arch-$(MODEL) include/asm/arch) > > > > _all: > > > > @@ -52,7 +54,8 @@ tinyx.hex: tinyx.elf > > $(OBJCOPY) -O ihex build/$< build/$@ > > > > tinyx.elf: $(tinyx.objs) > > - $(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > > + #$(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > > + $(CC) -Xlinker --script=arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > > > > $(tinyx.objs): > > @$(MAKE) target=$@ -f scripts/Makefile.build > > @@ -63,7 +66,6 @@ endef > > > > tags: > > $(call xtags, ctags) > > - > > .PHONY: clean > > clean: > > @cleandirs="$(shell $(PYTHON) scripts/expandtree.py $(tinyx.dirs))"; \ > > @@ -72,6 +74,6 @@ clean: > > cleanobjs="$$cleanobjs $$dir*.o"; \ > > done; \ > > echo "rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps"; \ > > - rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; > > + rm -f $$cleanobjs include/asm/arch include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; > > > > > > -- > > 1.5.3.7 > > > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > _______________________________________________ > > Tinyx-devel mailing list > > Tin...@li... > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > -- > Best Regards, > > Felipe Balbi > me...@fe... > http://blog.felipebalbi.com |
From: Felipe B. <me...@fe...> - 2008-01-12 17:57:29
|
On Sat, Jan 12, 2008 at 12:33:29PM -0400, David Cohen wrote: > This patch adds symbolic path to include/asm/arch directory and use gcc > instead of ld to link final tinyx image. > > Signed-off-by: David Cohen <da...@gm...> > --- > Makefile | 14 ++++++++------ > 1 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/Makefile b/Makefile > index 3b0a471..f452c11 100644 > --- a/Makefile > +++ b/Makefile > @@ -9,6 +9,7 @@ HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer > CROSS_COMPILE ?= arm-linux- > > ARCH = arm7 > +MODEL = lpc2xxx CPU would look better here. We could later, if cpu_is_lpc2xxx() and let gcc do the optimizations. > > AS = $(CROSS_COMPILE)as > LD = $(CROSS_COMPILE)ld > @@ -19,7 +20,7 @@ STRIP = $(CROSS_COMPILE)strip > OBJCOPY = $(CROSS_COMPILE)objcopy > OBJDUMP = $(CROSS_COMPILE)objdump > AWK = awk > -CFLAGS = -Wall -Os -mcpu=arm7tdmi > +CFLAGS = -Wall -Os -mcpu=arm7tdmi -nostdlib > INCLUDES = -Iinclude -Iinclude/libc > > PYTHON = python > @@ -28,14 +29,15 @@ MAKEFLAGS += --no-print-directory > > all-sources = $(shell git-ls-files) > > -export ARCH AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES > +export ARCH MODEL AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES > > tinyx.dirs = lib/ arch/ kernel/ > > tinyx.objs = $(patsubst %/, %/tyx_part.o, $(tinyx.dirs)) > > -$(shell rm -f $(tinyx.objs) include/asm) > +$(shell rm -f $(tinyx.objs) include/asm/arch include/asm) > $(shell ln -s asm-$(ARCH) include/asm) > +$(shell ln -s arch-$(MODEL) include/asm/arch) > > _all: > > @@ -52,7 +54,8 @@ tinyx.hex: tinyx.elf > $(OBJCOPY) -O ihex build/$< build/$@ > > tinyx.elf: $(tinyx.objs) > - $(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > + #$(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > + $(CC) -Xlinker --script=arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > > $(tinyx.objs): > @$(MAKE) target=$@ -f scripts/Makefile.build > @@ -63,7 +66,6 @@ endef > > tags: > $(call xtags, ctags) > - > .PHONY: clean > clean: > @cleandirs="$(shell $(PYTHON) scripts/expandtree.py $(tinyx.dirs))"; \ > @@ -72,6 +74,6 @@ clean: > cleanobjs="$$cleanobjs $$dir*.o"; \ > done; \ > echo "rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps"; \ > - rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; > + rm -f $$cleanobjs include/asm/arch include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; > > > -- > 1.5.3.7 > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel -- Best Regards, Felipe Balbi me...@fe... http://blog.felipebalbi.com |
From: Felipe B. <me...@fe...> - 2008-01-12 17:54:53
|
On Sat, Jan 12, 2008 at 12:58:31PM -0400, David Cohen wrote: > Hi all, > > We have to decide it. > Which one is better choice: > <libc/string.h> or <string.h>? <string.h> but you should change all the users of it in your patch > > Br, > > David > > On Jan 10, 2008 11:43 PM, David Cohen <da...@gm...> wrote: > > Hi, > > > > On Jan 10, 2008 11:39 PM, Anderson Briglia <and...@br...> wrote: > > > On 1/10/08, David Cohen <da...@gm...> wrote: > > > > > > > This is the other way for libc include's path. > > > > > > > > Any comments? Briglia? Balbi? > > > > > > IMHO, this way is the default, right? I still didn't see differents > > > include's paths due to different archs on linux kernel. > > > > You're right, but the arch's path is transparent. The two choices are: > > <libc/string.h> or <string.h> > > > > Which one is better? > > > > Regards, > > > > David > > > > > > > > > > BR, > > > > > > Anderson Briglia > > > > > > > > > > > > > > > > > > > Br, > > > > > > > > David Cohen > > > > > > > > On Jan 10, 2008 11:02 PM, David Cohen < da...@gm...> wrote: > > > > > Adding include/libc to standard include's path > > > > > Fixing new libc include path on device.c > > > > > > > > > > Signed-off-by: David Cohen < da...@gm...> > > > > > --- > > > > > Makefile | 2 +- > > > > > kernel/device.c | 2 +- > > > > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/Makefile b/Makefile > > > > > index 0ca9772..3b0a471 100644 > > > > > --- a/Makefile > > > > > +++ b/Makefile > > > > > @@ -20,7 +20,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy > > > > > OBJDUMP = $(CROSS_COMPILE)objdump > > > > > AWK = awk > > > > > CFLAGS = -Wall -Os -mcpu=arm7tdmi > > > > > -INCLUDES = -Iinclude > > > > > +INCLUDES = -Iinclude -Iinclude/libc > > > > > > > > > > PYTHON = python > > > > > > > > > > diff --git a/kernel/device.c b/kernel/device.c > > > > > index 44374ab..8cd35ba 100644 > > > > > --- a/kernel/device.c > > > > > +++ b/kernel/device.c > > > > > @@ -21,7 +21,7 @@ > > > > > > > > > > #include <tinyx/device.h> > > > > > #include <tinyx/list.h> > > > > > -#include <tinyx/libc/string.h> > > > > > +#include <string.h > > > > > > > > > > > DECLARE_LIST_HEAD(bus_list); > > > > > DECLARE_LIST_HEAD(driver_list); > > > > > -- > > > > > 1.5.3.7 > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > David Cohen > > > > Instituto Nokia de Tecnologia - INdT > > > > Manaus - Brazil > > > > > > > > ------------------------------------------------------------------------- > > > > Check out the new SourceForge.net Marketplace. > > > > It's the best place to buy or sell services for > > > > just about anything Open Source. > > > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > _______________________________________________ > > > > Tinyx-devel mailing list > > > > Tin...@li... > > > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > > > > > > > > > > > > > > > -- > David Cohen > Instituto Nokia de Tecnologia - INdT > Manaus - Brazil > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel -- Best Regards, Felipe Balbi me...@fe... http://blog.felipebalbi.com |
From: David C. <da...@gm...> - 2008-01-12 16:58:27
|
Hi all, We have to decide it. Which one is better choice: <libc/string.h> or <string.h>? Br, David On Jan 10, 2008 11:43 PM, David Cohen <da...@gm...> wrote: > Hi, > > On Jan 10, 2008 11:39 PM, Anderson Briglia <and...@br...> wrote: > > On 1/10/08, David Cohen <da...@gm...> wrote: > > > > > This is the other way for libc include's path. > > > > > > Any comments? Briglia? Balbi? > > > > IMHO, this way is the default, right? I still didn't see differents > > include's paths due to different archs on linux kernel. > > You're right, but the arch's path is transparent. The two choices are: > <libc/string.h> or <string.h> > > Which one is better? > > Regards, > > David > > > > > > BR, > > > > Anderson Briglia > > > > > > > > > > > > > > Br, > > > > > > David Cohen > > > > > > On Jan 10, 2008 11:02 PM, David Cohen < da...@gm...> wrote: > > > > Adding include/libc to standard include's path > > > > Fixing new libc include path on device.c > > > > > > > > Signed-off-by: David Cohen < da...@gm...> > > > > --- > > > > Makefile | 2 +- > > > > kernel/device.c | 2 +- > > > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/Makefile b/Makefile > > > > index 0ca9772..3b0a471 100644 > > > > --- a/Makefile > > > > +++ b/Makefile > > > > @@ -20,7 +20,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy > > > > OBJDUMP = $(CROSS_COMPILE)objdump > > > > AWK = awk > > > > CFLAGS = -Wall -Os -mcpu=arm7tdmi > > > > -INCLUDES = -Iinclude > > > > +INCLUDES = -Iinclude -Iinclude/libc > > > > > > > > PYTHON = python > > > > > > > > diff --git a/kernel/device.c b/kernel/device.c > > > > index 44374ab..8cd35ba 100644 > > > > --- a/kernel/device.c > > > > +++ b/kernel/device.c > > > > @@ -21,7 +21,7 @@ > > > > > > > > #include <tinyx/device.h> > > > > #include <tinyx/list.h> > > > > -#include <tinyx/libc/string.h> > > > > +#include <string.h > > > > > > > > > DECLARE_LIST_HEAD(bus_list); > > > > DECLARE_LIST_HEAD(driver_list); > > > > -- > > > > 1.5.3.7 > > > > > > > > > > > > > > > > > > > > -- > > > David Cohen > > > Instituto Nokia de Tecnologia - INdT > > > Manaus - Brazil > > > > > > ------------------------------------------------------------------------- > > > Check out the new SourceForge.net Marketplace. > > > It's the best place to buy or sell services for > > > just about anything Open Source. > > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > _______________________________________________ > > > Tinyx-devel mailing list > > > Tin...@li... > > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > > > > > > > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-12 16:56:30
|
Hi, I'm sending a new and better patch. This one is obsolete. Please, ignore it. Br, David On Jan 10, 2008 10:50 PM, David Cohen <da...@gm...> wrote: > Changing from extern to static some clock functions. > Fixing the clock's child list vector. > Adding rate_list. > Small fixes on generic clock functions. > > Signed-off-by: David Cohen <da...@gm...> > --- > arch/arm7/mach-lpc21xx/clock.c | 28 +++++++--------------------- > arch/arm7/mach-lpc21xx/clock.h | 28 +++++++++++++++++++++++++--- > arch/common/clock.c | 26 +++++++++++++++++++++----- > include/asm-generic/clock.h | 15 ++++++++++----- > 4 files changed, 63 insertions(+), 34 deletions(-) > > diff --git a/arch/arm7/mach-lpc21xx/clock.c b/arch/arm7/mach-lpc21xx/clock.c > index 61b00e3..19b2abb 100644 > --- a/arch/arm7/mach-lpc21xx/clock.c > +++ b/arch/arm7/mach-lpc21xx/clock.c > @@ -21,35 +21,21 @@ > > #include "clock.h" > > -unsigned int cclk_set_rate(struct clock *clk, unsigned int rate) > +static unsigned int cclk_set_rate(struct clock *clk, unsigned int rate) > { > return 0; > } > > -unsigned int pclk_set_rate(struct clock *clk, unsigned int rate) > +static void cclk_init(struct clock *clk) > { > - return 0; > } > > -void pclk_propagate(struct clock *clk, struct clock *parent) > +static unsigned int pclk_set_rate(struct clock *clk, unsigned int rate) > { > + return 0; > } > > -static struct clock pclk = { > - .id = PCLK, > - .num_child = 0, > - .child = NULL, > - .set_rate = pclk_set_rate, > - .propagate = pclk_propagate, > -}; > - > -static struct clock cclk = { > - .id = CCLK, > - .num_child = 1, > - .child = &pclk, > - .set_rate = cclk_set_rate, > - .propagate = NULL, > -}; > - > -struct clock *lpc2xxx_clk_list[] = { &cclk, &pclk }; > +static void pclk_propagate(struct clock *clk, struct clock *parent) > +{ > +} > > diff --git a/arch/arm7/mach-lpc21xx/clock.h b/arch/arm7/mach-lpc21xx/clock.h > index 214fd62..420ac16 100644 > --- a/arch/arm7/mach-lpc21xx/clock.h > +++ b/arch/arm7/mach-lpc21xx/clock.h > @@ -25,8 +25,30 @@ > #include <asm/arch-lpc2xxx/clock.h> > #include <tinyx/kernel.h> > > -extern unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); > -extern unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); > -extern void pclk_propagate(struct clock *clk, struct clock *parent); > +static unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); > +static void cclk_init(struct clock *clk); > +static unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); > +static void pclk_propagate(struct clock *clk, struct clock *parent); > + > +static struct clock pclk = { > + .id = PCLK, > + .num_child = 0, > + .child_list = NULL, > + .set_rate = pclk_set_rate, > + .propagate = pclk_propagate, > +}; > + > +static struct clock cclk = { > + .id = CCLK, > + .num_child = 1, > + .child_list = &pclk, > + .set_rate = cclk_set_rate, > + .propagate = NULL, > + .init = cclk_init, > + .init_rate = 15000000, > + .rate_list = { 15000000, 30000000, 45000000, 60000000, 0 }, > +}; > + > +struct clock *lpc2xxx_clk_list[] = { &cclk, &pclk }; > > #endif /* __ARCH_MACH_LPC2XXX_CLOCK_H */ > diff --git a/arch/common/clock.c b/arch/common/clock.c > index d92f09e..a7cc66f 100644 > --- a/arch/common/clock.c > +++ b/arch/common/clock.c > @@ -29,6 +29,12 @@ void clk_set_list(struct clock *list, unsigned int num) > { > clk_list = list; > num_clk = num; > + > + while (num--) { > + if (list->init) > + (*list->init)(list); > + list++; > + } > } > > void clk_propagate(struct clock *clk, struct clock *parent) > @@ -43,7 +49,7 @@ void clk_propagate(struct clock *clk, struct clock *parent) > (*clk->propagate)(clk, parent); > > c = clk->num_child; > - child = clk->child; > + child = clk->child_list; > > /* Revisit: fix recursive while */ > while (c--) { > @@ -52,20 +58,30 @@ void clk_propagate(struct clock *clk, struct clock *parent) > } > } > > -unsigned int clk_set_rate(struct clock *clk, unsigned int rate) > +unsigned int clk_set_rate(struct clock *clk, unsigned int clk_rate) > { > - unsigned int clk_rate = rate; > unsigned int c; > + unsigned int *rate_list; > struct clock *child; > > if (clk == NULL) > return 0; > > + rate_list = clk->rate_list; > + while (*rate_list) { > + if (clk_rate >= (*rate_list)++) { > + clk_rate = *rate_list; > + break; > + } > + } > + if (!(*rate_list)) > + clk_rate = 0; > + > if (clk->set_rate) > - clk_rate = (*clk->set_rate)(clk, rate); > + clk_rate = (*clk->set_rate)(clk, clk_rate); > > c = clk->num_child; > - child = clk->child; > + child = clk->child_list; > while (c--) { > clk_propagate(child, clk); > child++; > diff --git a/include/asm-generic/clock.h b/include/asm-generic/clock.h > index 4ac8e7c..43f33f4 100644 > --- a/include/asm-generic/clock.h > +++ b/include/asm-generic/clock.h > @@ -25,17 +25,22 @@ > struct clock { > unsigned int id; > unsigned int rate; > - struct clock *parent; > - struct clock *child; > + unsigned int flags; > unsigned int num_child; > + struct clock *child_list; > + > unsigned int (*set_rate) (struct clock *clk, unsigned int rate); > void (*propagate) (struct clock *clk, struct clock *parent); > + void (*init) (struct clock *clk); > + > + unsigned int init_rate; > + unsigned int rate_list[]; > }; > > #define clk_get_rate(clk) (clk)->rate > > -extern void clk_set_list(struct clock *list, unsigned int num); > -extern void clk_propagate(struct clock *clk, struct clock *parent); > -extern unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > +void clk_set_list(struct clock *list, unsigned int num); > +void clk_propagate(struct clock *clk, struct clock *parent); > +unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > > #endif /* __ASM_GENERIC_CLOCK_H */ > -- > 1.5.3.7 > > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-12 16:56:05
|
This patch changes temporary UART code on main.c to use clock subsystem. Signed-off-by: David Cohen <da...@gm...> --- kernel/main.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kernel/main.c b/kernel/main.c index 297562b..68d7f95 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -21,6 +21,7 @@ #include <asm/arch-lpc2xxx/lpc2xxx.h> #include <asm/arch-lpc2xxx/start_lpc2148.h> +#include <asm/arch/clock.h> #include <asm/io.h> #include <tinyx/list.h> #include <tinyx/kernel.h> @@ -39,7 +40,7 @@ static void init_uart0(void) { /* unsigned int clk = B115200((CRYSTAL_FREQUENCY * PLL_FACTOR) / VPBDIV_FACTOR); */ - unsigned int clk = B115200(PCLK); + unsigned int clk = B115200(clk_get_rate(PCLK)); __raw_writel(0x5, PINSEL0); __raw_writel(0x80, U0LCR); __raw_writel((clk & 0xff), U0DLL); -- 1.5.3.7 |
From: David C. <da...@gm...> - 2008-01-12 16:55:58
|
This patch implements clocks for LPC2XXX platform, using the generic clock subsystem. Signed-off-by: David Cohen <da...@gm...> --- arch/arm7/mach-lpc21xx/clock.c | 96 +++++++++++++++++++++++++++++++--------- arch/arm7/mach-lpc21xx/clock.h | 34 +++++++++++++- 2 files changed, 106 insertions(+), 24 deletions(-) diff --git a/arch/arm7/mach-lpc21xx/clock.c b/arch/arm7/mach-lpc21xx/clock.c index 61b00e3..b8003d9 100644 --- a/arch/arm7/mach-lpc21xx/clock.c +++ b/arch/arm7/mach-lpc21xx/clock.c @@ -19,37 +19,91 @@ * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. */ +#include <asm/io.h> +#include <asm/arch/lpc2xxx.h> +#include <asm/arch/start_lpc2148.h> + #include "clock.h" -unsigned int cclk_set_rate(struct clock *clk, unsigned int rate) +#define VAL_FEED1 0xAA +#define VAL_FEED2 0x55 + +#define FCCO_MIN 156000000 +#define FCCO_MAX 320000000 + +#define PLLCON_DIS (0 << 0) /* PLL Disable */ +#define PLLCON_EN (1 << 0) /* PLL Enable */ +#define PLLCON_CON (1 << 1) /* PLL Connect */ +#define PLLSTAT_LOCK (1 << 10) /* PLL Lock Status */ + +static unsigned int psel[4][2] = { + { 1, 0x0 << 5 }, + { 2, 0x1 << 5 }, + { 4, 0x2 << 5 }, + { 8, 0x3 << 5 }, +}; + +static unsigned int cclk_get_psel(unsigned int msel, unsigned int rate) { - return 0; + unsigned int p = 4; + unsigned int fcco = rate * 2 * msel; + + if ((fcco * psel[0][p]) < FCCO_MIN) + /* BUG: FCCO out of range */ + goto end; + + while (p) { + if ((fcco * psel[0][p]) > FCCO_MAX) + p--; + else + goto end; + } + + /* if ((fcco * psel[0][p]) > FCCO_MAX); BUG: FCCO out of range */ + +end: + return psel[1][p]; } -unsigned int pclk_set_rate(struct clock *clk, unsigned int rate) +static void cclk_set_pllcon(unsigned int con) { - return 0; + __raw_writew(con, PLLCON); + __raw_writew(VAL_FEED1, PLLFEED); + __raw_writew(VAL_FEED2, PLLFEED); } -void pclk_propagate(struct clock *clk, struct clock *parent) +static unsigned int cclk_set_rate(struct clock *clk, unsigned int rate) { -} + unsigned int msel; + unsigned int psel; -static struct clock pclk = { - .id = PCLK, - .num_child = 0, - .child = NULL, - .set_rate = pclk_set_rate, - .propagate = pclk_propagate, -}; + msel = rate / FOSC; + msel -= msel ? 1 : 0; -static struct clock cclk = { - .id = CCLK, - .num_child = 1, - .child = &pclk, - .set_rate = cclk_set_rate, - .propagate = NULL, -}; + psel = cclk_get_psel(msel, rate); + + /* Disabling PLL */ + cclk_set_pllcon(PLLCON_DIS); + + /* Configuring PLL */ + __raw_writew((msel | psel), PLLCFG); + cclk_set_pllcon(PLLCON_EN); + + /* Waiting for PLL Lock */ + while (!(__raw_readw(PLLSTAT) & PLLSTAT_LOCK)); + + /* Connecting PLL */ + cclk_set_pllcon(PLLCON_EN | PLLCON_CON); + + return (msel+1) * FOSC; +} -struct clock *lpc2xxx_clk_list[] = { &cclk, &pclk }; +static unsigned int pclk_set_rate(struct clock *clk, unsigned int rate) +{ + return 0; +} + +static void pclk_propagate(struct clock *clk) +{ +} diff --git a/arch/arm7/mach-lpc21xx/clock.h b/arch/arm7/mach-lpc21xx/clock.h index 214fd62..d68f374 100644 --- a/arch/arm7/mach-lpc21xx/clock.h +++ b/arch/arm7/mach-lpc21xx/clock.h @@ -25,8 +25,36 @@ #include <asm/arch-lpc2xxx/clock.h> #include <tinyx/kernel.h> -extern unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); -extern unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); -extern void pclk_propagate(struct clock *clk, struct clock *parent); +static unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); +static unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); +static void pclk_propagate(struct clock *clk); + +static struct clock pclk; +static struct clock cclk; + +static struct clock pclk = { + .id = PCLK, + .flags = CLK_ENABLED, + .rate = 12000000, + .parent = &cclk, + .child_list = NULL, + .set_rate = pclk_set_rate, + .propagate = pclk_propagate, + .rate_list = { 12000000, 0 }, +}; + +static struct clock *cclk_childs[2] = { &pclk, NULL }; + +static struct clock cclk = { + .id = CCLK, + .flags = CLK_ENABLED | CLK_PRIMARY, + .rate = 12000000, + .child_list = cclk_childs, + .set_rate = cclk_set_rate, + .propagate = NULL, + .rate_list = { 12000000, 48000000, 0 }, +}; + +struct clock *lpc2xxx_clk_list[] = { &cclk, &pclk , NULL }; #endif /* __ARCH_MACH_LPC2XXX_CLOCK_H */ -- 1.5.3.7 |