From: Detlev Zundel Date: Tue, 08 Nov 2011 17:22:40 +0100 Subject: [U-Boot] [PATCH] dfu: initial implementation In-Reply-To: <000001cc9d46$84ea7050$8ebf50f0$%p@samsung.com> (Andrzej Pietrasiewicz's message of "Mon, 07 Nov 2011 13:12:28 +0100") References: <1320228007-8947-1-git-send-email-andrzej.p@samsung.com> <20111103181352.3022F16F8444@gemini.denx.de> <000601cc9abe$4f544bd0$edfce370$%p@samsung.com> <20111105153357.0CF19189300E@gemini.denx.de> <000001cc9d46$84ea7050$8ebf50f0$%p@samsung.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Andrzej, [...] >> > > If my assumption is correct, then what would it take to split off >> > > protocol part and make it independent of the actual driver >> interface? >> > >> > I guess that in the situation given it would be of little use. >> >> What do you think would be of little use? >> > > As far as I understand you correctly, you would like the state > machine code extracted from the initial DFU implementation posted > on this mailing list. And then you would like the DFU implemented > in terms of this abstract state machine. This means actually > more code, probably not a desired thing. The generic state machine > would also require some accompanying generic data structures, > and this would also mean code to translate back and forth between > USB/DFU (DFU _is_ USB) and state machine's data structures. > All in all, this means adding more complexity and code. This looks > like a premature optimization (which is widely known to be the root > of all evil), while at the moment, there are no use cases > to justify it. Should the use cases appear, the code can be reworked > based on the needs of both USB/DFU and new state machine users. Just to add my personal opinion here - I am occassionally lobbying for a long time on this mailing list that mainline U-Boot gains DFU support, so please let's get this working with the existing tools and in the existing contexts, i.e. USB. Personally I consider it to be completely out of scope to dis-entangle DFU from its specification and abstract it into something which it _could_ be, but really _isn't_. When the implementation for USB is here, we all have much better grounds to discuss possible generalizations (although I doubt that there are many). Cheers Detlev -- Perfecting oneself is as much unlearning as it is learning. -- Edsger Dijkstra -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de