From owner-freebsd-drivers@freebsd.org Fri Jul 13 08:57:27 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 BC55D102FC73 for ; Fri, 13 Jul 2018 08:57:27 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (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 39C467C012 for ; Fri, 13 Jul 2018 08:57:27 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id v25-v6so8104147wmc.0 for ; Fri, 13 Jul 2018 01:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=hdxYrEv2RZvf+fo83xy6VrO44Ueh50HaRqNBa3TAfUE=; b=fYPJ1Q6YDivMPQ5kbWaDjeXqMwQM+L7SvevnAbq53H7LFs55DJf/sjR1mXfL/iW6AX AX9CDe9LnUhy/Z9QexD4pCP6FpmNfZTjr0nEPvxfr6Pn8f2GbJHT3NlUsBBn0DRYrK9g BTmdip7xx6dp26lYOgQYgYAUWd24naainbO/SkpK8Q39pwuxb7Nb7Yzmlxr8G6s4TLVR a32VggOcyRM6bSK00MPEXvhJ2044qhJljrceq6YUd3mmomWRwgQfhcElVlKGHOefkCbr 0ICwY7uR606BddbveiASiyc3jL5pDkm8uY6OjUWjCCWty9fD3xDaM9BIORCg82+cOv/U w76w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hdxYrEv2RZvf+fo83xy6VrO44Ueh50HaRqNBa3TAfUE=; b=VRMQn1oGhw69qaxN025nVoje60Jt881i6w4ceyq2cKhYiqDxl1m1AZ8T3ilJ/awpiV V4vDoPS8vmppTpbzQMVuuyDXgj3ohVJuL1mdUg3yLbmBOjfLURnYCPCr/l71441YVs7W +nllrog36bkD0GWmLDOCorgBUfHBz/M+1ZCNUyvFvfrV/A3McnPyMxnE6axGKuc32YPW 3X0woNjSHiYgIFOlsG1DMwozfyB5uXo2XDlT0jmKsSVYTTEdRgpYozWrjVUJbYaApWl9 ZE0GtWrchd3YADuiwFkX4iRZkk2WNo34JBowr5Q6lKE0HUesrKSqrxuUY8D7hySa49v9 C5ig== X-Gm-Message-State: AOUpUlG1P3xmvpe1is0yH7xZsijhcphq9+bLKexjrrSajt5sfgTFo/EM krFqFyn+lfDxFevtW9aowae6lONkU0KCKKCqTFOa0A== X-Google-Smtp-Source: AAOMgpfMBQYUtc8ziVi9Kv9jIeimzcTz6FeWNnTB8Wt+O/ggWgBP9MAeO25vpcSdhkSuQkPM0IogQKCHcCPRbAF/WLk= X-Received: by 2002:a1c:ad42:: with SMTP id w63-v6mr3597313wme.100.1531472246000; Fri, 13 Jul 2018 01:57:26 -0700 (PDT) MIME-Version: 1.0 From: Rajesh Kumar Date: Fri, 13 Jul 2018 14:27:14 +0530 Message-ID: Subject: Any read materials to understand uart device driver architecture in FreeBSD. To: 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 08:57:28 -0000 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. From owner-freebsd-drivers@freebsd.org Fri Jul 13 09:10:01 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 3E9A11030384 for ; Fri, 13 Jul 2018 09:10:01 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (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 C1F487C4B4 for ; Fri, 13 Jul 2018 09:10:00 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: by mail-io0-x232.google.com with SMTP id l7-v6so30737122ioj.1 for ; Fri, 13 Jul 2018 02:10:00 -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=WpKfkvI8+S2e2hu3lpiBaMh6uwcuC0PrmH91HphuvjE=; b=Kzhg7TmxAITJsJSFWrRfW8xCNvWpgiFmr56zCNbnVMGYc/nOfA2XJyO0nMkvuKkwPU Uz5UIL3bDavCZrNBxG6/R1rlHMzX7sBjxniGWvpN/RWTdU7OJZu1zBJACHyOo4szeVPt 2CauJ+6CdxYIxEweJq5dFqG1AXZ5fn4NXkHBoKh/hZj5twLBBkWV5Qx+pDhafSK6uJRf 29xVnPVqpwGY8qjVBoH2x5R4QO79+jiVfs44xPnDQZCzK63kxWnY5lLUcIObCloiN1c6 duqwCw9UY1AZZQL5MUL8dd4vybEppWOhN4Lqn4WWIwSR40DFBP4sqLrikHDlFJkO9OJ1 x1eA== 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=WpKfkvI8+S2e2hu3lpiBaMh6uwcuC0PrmH91HphuvjE=; b=ZUTygs2NzY11kyHHhk3eWdInmqFplwudklpmSkF26fudVgHNXjcIKLFUis37sfgXzF 7agGYggVqcY4TRmiSrQU6gBT9u6HDCrBLTbda5xkwubko+sTjznNFqin2V50LSgJxm1j QnvAiAHTgJfSINfz7Dg8d24+yafg/VSiemsyHXwYTZfTX70M0Tk9bEn6W3HlKPDa28vb A5T3MdXx4kEuzwVVoRH92kSPR3UDS4I3l4nKf5cSTpRzzMdgKW/zA70pYmYnBzeV2GQY /0i70K3d855ib9ggGWmaqmKppimcJO7iVG0YqTVKTl0NfRf3nZOBfgbniuRDAhITDKgd f8vg== X-Gm-Message-State: APt69E25nJh/yJ1/IB3Ufuw9ebh3qg7PI+gs+mk8BQcNFOX2740r+bll COWjCD2jjhgmZ7MLEq4t9cTsbVnYGPLgTWtcSF4= X-Google-Smtp-Source: AAOMgpfZ6oUXD56ujYddtPnp5EplM6vrcKkjQ0cTgaaz/3bflUHxEYUjAT4C0Jf01Znt/oewjaDMsA+kXf/swzzbFD8= X-Received: by 2002:a6b:1bd5:: with SMTP id b204-v6mr31493369iob.240.1531473000160; Fri, 13 Jul 2018 02:10:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: blubee blubeeme Date: Fri, 13 Jul 2018 17:10:19 +0800 Message-ID: Subject: Re: Any read materials to understand uart device driver architecture in FreeBSD. To: Rajesh Kumar 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:10:01 -0000 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 > 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 > >>