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.