From owner-freebsd-drivers@freebsd.org Fri Jul 13 09:41:32 2018 Return-Path: Delivered-To: freebsd-drivers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A8A910313D2 for ; Fri, 13 Jul 2018 09:41:32 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14B397D565 for ; Fri, 13 Jul 2018 09:41:32 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id j5-v6so17927182wrr.8 for ; Fri, 13 Jul 2018 02:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SMHYXnhAxU++Ybp3A5Nvnk4tJ2ujoeA1xNRNi28kVdM=; b=hVIt3GhG3DJQF+MWNwq6fh4zZzR+4rXSFaK4iqXPskrIJ30brOkI927FVBpXl+Jzn8 LbEht9oa5RBhpTFdr1u6WLCKpLB+ch2y33OxgrCsAi+ZRRGgxx4bVPmFT2GTC1oAEtFS Nk8TtcRXolVGpJQPrSFZ7oZ3O1WdUOIdXrpC+Y00olGnEPxdXcD4+i2xlyevec0c/2x/ kVBVokwTrcwnry/QJRhikDWnFYX3XX4HkEqeq5tgtL0QrbzXyypsi2CvJZ33Y4eoCYxZ ybO642gqjjjyepzbTDlcI3Sdqc9NUrFPHgPBjEzFX7pfTK7ncbmiC7b+t/ySfrHMKb3X zskQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SMHYXnhAxU++Ybp3A5Nvnk4tJ2ujoeA1xNRNi28kVdM=; b=bftw5vTDpFrTfuRiHIn1t1mNsd/qEn6Ec+uJA4QvHHjyk2OdZ8gEysr/5AP2gg5dmM 6QNQkaaSAIoSjSn8sXIQKlexGaHhiOnEgkcdq8c3joAH/9rWrbE7b2S4/3GrkU3mre7D seMCT+96lqR6BAzsWHZCvC6j1CrY6qlS7PHV0O8g8S/EsL6XjWAVPL21+FHGBKzMklFF BwlT0TRE+XadYtmBYaKlH7uu1v9bfZPzNTBLBs3QcUSzk5+86qnWXLZp9MNLpG6hnkzQ t/sJQcMXmR+jNxRoTxbO4C/xJd8M6+0B4WSzCMP4Fpjawu1h5+FjEiQfE6Fi94fe+C/g 6DCA== X-Gm-Message-State: AOUpUlFOyI4hsJvgEMW/C9ESDkzrbXRGPQ/3Xgrf9Bk6oZdloxsxJb+h wDTnKOzT+6ssWiA2sIFU0Jv57uxPRh+bRNGcdyIf2w== X-Google-Smtp-Source: AAOMgpf5fL4ONMhy+OEVt9kZFAmdcNGPqZrODmQ1iOThquPwg1+GjfKtTnHZ60+z6pEUQF/BPvahqrvsdueravst7JU= X-Received: by 2002:adf:ba12:: with SMTP id o18-v6mr4543778wrg.249.1531474890051; Fri, 13 Jul 2018 02:41:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rajesh Kumar Date: Fri, 13 Jul 2018 15:11:18 +0530 Message-ID: Subject: Re: Any read materials to understand uart device driver architecture in FreeBSD. To: gurenchan@gmail.com Cc: freebsd-drivers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2018 09:41:33 -0000 Hi blubee, Thanks for your quick response. Definitely, these two books are good reads. But, I was looking for some information regarding the code design from the perspective of existing uart code base in FreeBSD source (sys/dev/uart), not just generic device driver concepts and overall system architecture. Anyway, thanks again for your inputs. On Fri, Jul 13, 2018 at 2:40 PM blubee blubeeme wrote: > > On Fri, Jul 13, 2018, 16:57 Rajesh Kumar wrote: > >> Hi, >> >> I am trying to understand the uart device drivers architecture in FreeBSD. >> I see the following set of file in sys/dev/uart. >> >> a) uart_bus_xxxx -> one file each for acpi, pci, isa bus etc., >> b) uart_core - uart common routines >> c) uart_cpu_xxxx -> one file each for x86, powerpc etc., >> d) uart_dev_xxxx -> I assume this is one file each for seperate uart IP's. >> e) some other files. >> >> Questions : >> a) Is there any good read materials to understand the uart driver >> architecutre (from code perspective) in FreeBSD? >> b) If I need to write a new uart driver for a uart IP, what are the things >> to do? I assume i need to have a seperate uart_dev_* file and need to add >> that device ID in appropriate uart_bus_* file? what other things I need to >> take care? >> c) In uart_bus_acpi.c and uart_bus_isa.c, I see the definitions of >> acpi_ns8250_ids and isa_ns8250_ids list. Where are those ID's derived >> from? I understand PNP ID, ACPI ID and PCI Vendor and Device ID, but not >> sure about those above mentioned IDs? >> >> Thanks, >> Rajesh. >> _______________________________________________ >> freebsd-drivers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-drivers >> To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org >> " >> > > Writing drivers: https://nostarch.com/bsddrivers.htm > > FreeBSD architecture: > https://www.amazon.com/Design-Implementation-FreeBSD-Operating-System/dp/0321968972 > >>